.my-extension-resultPage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background-color: #111827;
}

.my-extension-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #111827;
    color: white;
    padding: 8px;
    display: flex;
    justify-content: end;
    font-size: 0.9em;
    font-weight: bold;
    z-index: 9999999;
}

.my-extension-settings-btn, .my-extension-share-btn {
    display: inline-block;
    cursor: pointer;
    margin-right: 15px;
}

.my-extension-settings-btn {
    /* 设置按钮样式 */
    margin-right: 10px;
}

.my-extension-content {
    display: block;
    padding-right: 10px;
    padding-left: 10px;
    position: absolute;
    right: 0;
    left: 0;
    top: 25px;
    bottom: 120px;
    background-color: #111827;
    overflow-x: auto; 
    overflow-y: auto; 
    line-height: 1.6;
    color: white;
}

.my-extension-content h1 {
  color: #28a745;
  font-size: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 10px 0;
  display: block;
}

.my-extension-content h2,h3,h4 {
  color: #28a745;
  font-weight: bold;
  font-size: 17px;
  padding: 10px 0;
  margin: 10px 0 10px;
  font-family: 'Arial', sans-serif;
  display: block;
}

.my-extension-content h3 {
  font-size: 15px;
}

.my-extension-content h4 {
  font-size: 12px;
}

.my-extension-content a {
  color: white;
  text-decoration: underline;
  font-weight: bold;
}

.search-source {
  display: block !important;
  font-size: 13px;
  margin-bottom: 3px;
}

.my-extension-content ul, .my-extension-content ol {
  padding-left: 20px;
  margin: 0;
}

.my-extension-content ul {
  list-style-type: disc;
}

.my-extension-content ol {
  list-style-type: decimal;
}

.my-extension-content li {
  display: list-item;
  padding-left: 5px;
  color: white;
  font-size: 15px;
}

.my-extension-content pre, .my-extension-content code {
  background-color: #282c34;
  color: #fff;
  overflow-x: auto;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
  border-radius: 2px;
  padding: 0.1em;
  font-family: 'Consolas', 'Monaco', 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace;
  font-size: 0.85em;
}

.my-extension-content p {
  font-size: 15px;
  line-height: 1.6;
  color: white;
}

.my-extension-dialogue {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  background-color: #111827;
  border-top: 1px solid #111827;
  box-sizing: border-box;
}

.my-extension-dialogue textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #3C3C3C;
  background-color: #111827;
  color: white;
  font-size: 15px;
  border-radius: 5px;
  resize: none; /* 禁止用户手动调整大小 */
  box-sizing: border-box;
}

.my-extension-dialogue-submit, .my-extension-dialogue-generate {
  padding: 5px;
  background-color: #3C3C3C;
  color: white;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  margin-left: 5px;
}

.my-extension-dialogue-submit.disabled {
  cursor: not-allowed;
}

.my-extension-dialogue-generate {
  display: none;
}

.ai-message {
  position: relative;
  padding-bottom: 15px;
}


.ai-message p {
  word-wrap: break-word; /* 允许长单词换行 */
  overflow-wrap: break-word; /* 处理超长单词换行，兼容性更好 */
  max-width: 100%;
}

.user-message:not(:first-of-type) {
  border-top: 1px solid #3C3C3C;
  padding-top: 20px;
}

.tool-card {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tool-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
}

.tool-card__status {
    font-size: 12px;
    color: #93c5fd;
}

.tool-card__status.is-running {
    color: #fbbf24;
}

.tool-card__status.is-success {
    color: #34d399;
}

.tool-card__status.is-error {
    color: #f87171;
}

.tool-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-card__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tool-card__toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
}

.tool-card__toggle:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.6);
    outline-offset: 2px;
}

.tool-card__toggle svg {
    transition: transform 0.2s ease;
}

.tool-card.is-collapsed .tool-card__body {
    display: none;
}

.tool-card.is-collapsed .tool-card__toggle svg {
    transform: rotate(-90deg);
}

.tool-card__section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tool-card__query {
    font-size: 13px;
    color: #e5e7eb;
    background-color: rgba(147, 197, 253, 0.08);
    padding: 8px 10px;
    border-radius: 8px;
    word-break: break-word;
}

.tool-card__answer {
    background-color: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
}

.tool-card__answer-content {
    font-size: 13px;
    line-height: 1.6;
    color: #d1fae5;
    margin-top: 6px;
    white-space: pre-wrap;
}

.tool-card__list {
    display: flex;
    flex-direction: column;
}

.tool-card__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid #2d3748;
}

.tool-card__row:first-child {
    border-top: none;
    padding-top: 0;
}

.tool-card__link {
    color: #bfdbfe;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.tool-card__link:hover {
    color: #60a5fa;
}

.tool-card__meta {
    font-size: 12px;
    color: #9ca3af;
}

.tool-card__snippet {
    font-size: 13px;
    color: #e5e7eb;
    line-height: 1.5;
}

.tool-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid rgba(59, 130, 246, 0.25);
    transition: background-color 0.2s ease;
}

.tool-card__button:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

.tool-card__empty {
    font-size: 13px;
    color: #94a3b8;
    background-color: rgba(148, 163, 184, 0.12);
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 10px;
    text-align: left;
}

.tool-card__error {
    font-size: 13px;
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: 8px;
    padding: 10px;
}

.tool-card__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.tool-card__figure {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: rgba(31, 41, 55, 0.6);
    border-radius: 10px;
    padding: 10px;
}

.tool-card__image {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    background-color: #111827;
}

.tool-card__caption {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.tool-card__prompt {
    font-size: 13px;
    color: #e5e7eb;
    line-height: 1.5;
    background-color: rgba(147, 197, 253, 0.08);
    padding: 10px;
    border-radius: 8px;
    white-space: pre-wrap;
}

.tool-card-serpapi {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 12px 28px rgba(8, 47, 73, 0.35);
}

.tool-card-serpapi .tool-card__header {
    margin-bottom: 4px;
}

.serp-card__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.32);
}

.serp-card__summary-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #bfdbfe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.serp-card__caret svg {
    color: #bfdbfe;
}

.serp-card__label {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.serp-card__results {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.serp-card__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid transparent;
    color: #e2e8f0;
    font-size: 13px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.serp-card__pill:hover {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.32);
    transform: translateY(-1px);
}

.serp-card__pill-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5f5;
}

.serp-card__pill-icon img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.serp-card__pill-text {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.serp-card__pill.is-hidden {
    display: none;
}

.serp-card__pill--more {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.serp-card__pill--more:hover {
    background: rgba(59, 130, 246, 0.24);
}

.serp-card__pill--more.is-expanded {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(14, 165, 233, 0.32);
    color: #bae6fd;
}

.serp-card__insight {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.serp-card__insight-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6ee7b7;
}

.serp-card__insight-text {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #d1fae5;
}

.serp-card__query {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    word-break: break-word;
}

.tool-card-dalle .tool-card__status.is-success {
    color: #60a5fa;
}

.tool-card-nano-banana .tool-card__status.is-success {
    color: #facc15;
}

.ai-image-result {
    margin-top: 16px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.ai-image-result .tool-card__section-title {
    margin-top: 0;
}

.tool-card__actions .tool-card__button {
    flex: 1 1 auto;
    text-align: center;
}

.tool-card__actions .tool-card__button:last-child {
    margin-right: 0;
}

.tool-card-unknown .tool-card__title {
    color: #f97316;
}

.tool-card-unknown .tool-card__status {
    color: #f87171;
}

.my-extension-loading {
    position: fixed;
    bottom: 115px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 100000;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 5px;
    font-size: 14px;
}


.my-extension-slogan {
  margin: 26px 12px 6px;
  padding: 4px 0 14px 12px;
  color: #E2E8F0;
}

.slogan-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
}

.slogan-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1FADFF 0%, #5B5BE7 100%);
  color: #F8FAFC;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 20px 35px rgba(59, 130, 246, 0.28);
}

.slogan-brand {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.slogan-subtitle {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(203, 213, 225, 0.78);
  font-weight: 500;
}

.my-extension-note {
  font-size: 12px;
  color: #9E9E9E;
  margin-top: 20px;
}

.chat-content {
  max-height: 100%;
  padding-right: 12px;
  padding-left: 12px;
}

.chat-content img {
  max-width: 100%;
  display: block;
}

.feature-container {
  margin: 22px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.75);
}

.feature-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38BDF8 0%, #6366F1 100%);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
}


.feature-item {
  padding: 14px 16px;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.48);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-item:hover,
.feature-item:focus-within {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 16px 24px rgba(15, 23, 42, 0.4);
  transform: translateY(-1px);
}

.feature-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.feature-visual {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  flex-shrink: 0;
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-name {
  font-size: 15px;
  font-weight: 600;
  color: #F8FAFC;
}

.feature-desc {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(203, 213, 225, 0.75);
}

.navigation-bar {
  position:fixed;
  bottom: 70px;
  display: flex;
  justify-content: start;
  align-items: center;
  padding: 10px;
  background-color: #111827;
}

.navigation-bar > div {
  margin-right: 10px;
}

#model-selection {
  padding: 5px 10px;
  border: 1px solid #3C3C3C;
  border-radius: 5px;
  background-color: #111827;
  color: white;
  width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#image-upload-label, #newchat-label, #params-label, #tools-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 5px;
  border-radius: 5px;
  background-color: #7c7a7a;
}

#newChat-div {
  right:10px !important;
}

.icon-copy {
  width: 16px;
  height: 16px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  position: absolute;
  right: 5px;
  padding-bottom: 5px;
}

.icon-copy:hover {
  color: white;
}

.image-preview-area {
  position: fixed;
  right: 16px;
  bottom: 120px;
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 360px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.55);
  color: #E5E7EB;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1000;
}

.image-preview-area.is-visible {
  display: flex;
}

.img-container {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.img-container:hover {
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateY(-1px);
}

.uploaded-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
}

.delete-image-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(248, 113, 113, 0.4);
  fill: none;
  stroke: #F87171;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.img-container:hover .delete-image-btn {
  opacity: 1;
  transform: scale(1.05);
}

/* 加载指示器样式 */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1;
}

.shortcut-menu {
  display: none;
  position: fixed;
  background-color: #111827;
  border: 1px solid #3C3C3C;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 200px;
  left: 10px;
  bottom: 115px;
  color: white;
}

.model-params {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 120px;
  width: 280px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.55);
  color: #E5E7EB;
  z-index: 1000;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.shortcut-menu div {
  padding: 8px 16px;
  cursor: pointer;
  display: flex; 
  align-items: center;
}
.shortcut-menu div:hover {
  background-color: #3C3C3C;
}

.shortcut-menu svg {
  flex-shrink: 0;
  margin-right: 8px;
}

.shortcut-text-span {
  line-height: 1; 
  margin-left: 8px;
}

.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.model-params h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #F3F4F6;
}

.params-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.params-item + .params-item {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.params-item label {
  font-size: 13px;
  font-weight: 600;
  color: #E5E7EB;
}

.params-item input[type="number"] {
  width: 80%;
  padding: 8px 12px;
  text-align: left;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  color: #E5E7EB;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.params-item input[type="number"]:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
  background: rgba(30, 41, 59, 0.95);
}

.tool-store {
  position: fixed;
  display: none;
  left: 16px;
  bottom: 120px;
  width: 280px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.55);
  color: #E5E7EB;
  z-index: 1000;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.toolbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toolbox-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #F3F4F6;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.tool-item:hover {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 14px 30px rgba(30, 64, 175, 0.35);
  transform: translateY(-2px);
}

.tool-item:active {
  transform: translateY(0);
}

.tool-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.25), rgba(79, 70, 229, 0.25));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-emoji {
  font-size: 22px;
}

.tool-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #F9FAFB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-description {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tool-toggle {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.tool-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-indicator {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.45);
  position: relative;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: inline-block;
}

.toggle-indicator::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #94A3B8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.tool-toggle input:focus-visible + .toggle-indicator {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

.tool-toggle input:checked + .toggle-indicator {
  background: linear-gradient(135deg, #38BDF8, #6366F1);
  border-color: rgba(99, 102, 241, 0.85);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.45);
}

.tool-toggle input:checked + .toggle-indicator::after {
  transform: translateX(18px);
  background: #FFFFFF;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.error-message {
  color: #ff4d4d;
  padding: 10px;
  border: 1px solid #ff4d4d;
  border-radius: 5px;
  margin: 20px 0;
}

.error-message__title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

.error-message__detail {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

.error-message__raw {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  word-break: break-word;
  white-space: pre-wrap;
}

.user-message {
  position: relative;
  align-self: flex-end;
  color: #28a745;
  font-size: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 10px 0;
  display: block;
}

.edit-message-btn {
  position: absolute;
  bottom: 1px;
  right: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-message:hover .edit-message-btn {
  opacity: 1;
}

.edit-message-btn svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.edit-message-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.18), rgba(17, 24, 39, 0.92));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.45);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.edit-message-container:hover {
  border-color: rgba(99, 179, 237, 0.4);
  box-shadow: 0 20px 44px rgba(30, 64, 175, 0.35);
}

.edit-message-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.edit-message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.75), rgba(14, 165, 233, 0.75));
  color: #f8fafc;
  box-shadow: 0 8px 16px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
}

.edit-message-icon svg {
  width: 18px;
  height: 18px;
}

.edit-message-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-message-title {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.edit-message-hint {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.5;
}

.edit-message-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 420px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.edit-message-textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.edit-message-textarea:focus {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

.edit-message-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-message-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(226, 232, 240, 0.65);
  font-size: 12px;
  white-space: nowrap;
}

.edit-message-count {
  font-weight: 600;
  color: #cbd5f5;
}

.edit-message-shortcuts {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  color: rgba(147, 197, 253, 0.95);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.edit-message-buttons {
  display: flex;
  gap: 10px;
}

.save-message-btn,
.cancel-message-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  background: transparent;
  color: #e2e8f0;
}

.save-message-btn {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(56, 189, 248, 0.8));
  color: #0b1120;
  box-shadow: 0 12px 20px rgba(56, 189, 248, 0.35);
}

.save-message-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 24px rgba(56, 189, 248, 0.45);
}

.cancel-message-btn {
  background: rgba(148, 163, 184, 0.15);
  color: rgba(226, 232, 240, 0.85);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.cancel-message-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  opacity: 0.9;
}

.save-message-btn svg,
.cancel-message-btn svg {
  width: 16px;
  height: 16px;
}

.edit-message-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* KaTeX 公式样式控制 */
.chat-content .katex-display {
    /* 限制公式容器的最大宽度 */
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    margin: 0.5em 0;
}

.chat-content .katex {
    /* 允许公式内部文本换行 */
    white-space: normal !important;
    /* 确保公式不会超出容器 */
    max-width: 100%;
}

.chat-content .katex-html {
    /* 允许 HTML 输出换行 */
    white-space: normal !important;
    /* 确保换行时数学符号对齐 */
    text-align: left;
}

/* 处理长公式的滚动条样式 */
.chat-content .katex-display::-webkit-scrollbar {
    height: 4px;
}

.chat-content .katex-display::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-content .katex-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.chat-content .katex-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 同样处理弹出窗口中的公式 */
#fisherai-transpop-id .katex-display,
#fisherai-transpop-id .katex,
#fisherai-transpop-id .katex-html {
    max-width: 100%;
    overflow-x: auto;
    white-space: normal !important;
}

/* 确保公式容器不会影响整体布局 */
.chat-content, #fisherai-transpop-id {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* 思考区块样式 */
.thinking-block {
  margin: 15px 0;
  border-radius: 8px;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow: hidden;
  transition: all 0.3s ease;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: rgba(59, 130, 246, 0.15);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  cursor: pointer;
  user-select: none;
}

.thinking-header-left {
  display: flex;
  align-items: center;
}

.thinking-icon {
  color: #3b82f6;
  margin-right: 8px;
}

.thinking-title {
  font-size: 14px;
  font-weight: 600;
  color: #3b82f6;
}

.thinking-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.thinking-toggle:hover {
  background-color: rgba(59, 130, 246, 0.2);
}

.toggle-icon {
  color: #3b82f6;
  transition: transform 0.3s ease;
}

.thinking-content {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre-wrap;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  transition: padding 0.3s ease;
}

/* 折叠状态 */
.thinking-block.collapsed .thinking-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.thinking-block.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.thinking-content p {
  margin: 8px 0;
}

.thinking-content code {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}

.thinking-content pre {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 10px 0;
}

/* 隐藏的思考内容 */
.hidden-thinking {
  display: none;
}

/* 在划词翻译中的思考区块样式调整 */
#fisherai-transpop-id .thinking-block {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

#fisherai-transpop-id .thinking-header {
  background-color: rgba(59, 130, 246, 0.15);
}

#fisherai-transpop-id .thinking-content {
  color: rgba(0, 0, 0, 0.9);
}

/* 暗色主题下的调整 */
@media (prefers-color-scheme: dark) {
  #fisherai-transpop-id .thinking-content {
    color: rgba(255, 255, 255, 0.9);
  }
}

/* API密钥通知样式 */
.api-key-notice {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  color: #333;
  margin: 20px auto;
  max-width: 90%;
  text-align: center;
  transition: all 0.3s ease;
}

.key-notice-icon {
  font-size: 38px;
  margin-bottom: 15px;
}

.api-key-notice h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #2c3e50;
}

.api-key-notice p {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 15px;
  color: #34495e;
}

.key-notice-info {
  background-color: rgba(52, 152, 219, 0.1);
  border-left: 4px solid #3498db;
  padding: 12px;
  margin: 15px 0;
  border-radius: 0 8px 8px 0;
  text-align: left;
}

.info-icon {
  margin-right: 8px;
  color: #3498db;
}

.setup-key-btn {
  display: inline-block;
  background-color: #3498db;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.setup-key-btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .api-key-notice {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    color: #ecf0f1;
  }
  
  .api-key-notice h3 {
    color: #ecf0f1;
  }
  
  .api-key-notice p {
    color: #bdc3c7;
  }
  
  .key-notice-info {
    background-color: rgba(52, 152, 219, 0.15);
  }
}

/* Light Mode Styles for side panel */
.light-mode.my-extension-resultPage {
  background-color: #FFFFFF;
}

.light-mode .my-extension-header {
  background-color: #FFFFFF;
  color: #1A202C;
  border-bottom: 1px solid #E2E8F0;
}

.light-mode .my-extension-settings-btn svg,
.light-mode .my-extension-share-btn svg {
  stroke: #4A5568;
}

.light-mode .my-extension-content {
  background-color: #FFFFFF;
  color: #1A202C;
}

.light-mode .my-extension-content h1,
.light-mode .my-extension-content h2,
.light-mode .my-extension-content h3,
.light-mode .my-extension-content h4 {
  color: #2D3748;
}

.light-mode .my-extension-content a {
  color: #3182CE;
}

.light-mode .my-extension-content li {
  color: #1A202C;
}

.light-mode .my-extension-content pre,
.light-mode .my-extension-content code {
  background-color: #F7FAFC;
  color: #1A202C;
  border: 1px solid #E2E8F0;
}

.light-mode .my-extension-content p {
  color: #1A202C;
}

.light-mode .my-extension-dialogue {
  background-color: #FFFFFF;
  border-top: none;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.light-mode .my-extension-dialogue textarea {
  border: 1px solid #E2E8F0;
  background-color: #F7FAFC;
  color: #1A202C;
}

.light-mode .my-extension-dialogue-submit,
.light-mode .my-extension-dialogue-generate {
  background-color: #E2E8F0;
  color: #1A202C;
}

.light-mode .user-message:not(:first-of-type) {
  border-top: 1px solid #E2E8F0;
}

.light-mode .my-extension-loading {
  background-color: rgba(255, 255, 255, 0.8);
  color: #1A202C;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.light-mode .my-extension-slogan {
  color: #1F2937;
}

.light-mode .slogan-title {
  color: #0F172A;
}

.light-mode .slogan-brand {
  color: #0F172A;
}


.light-mode .slogan-subtitle {
  color: rgba(30, 41, 59, 0.65);
}

.light-mode .slogan-accent {
  background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(59, 130, 246, 0.3);
}

.light-mode .feature-title {
  color: rgba(71, 85, 105, 0.75);
}

.light-mode .feature-title::before {
  background: linear-gradient(135deg, #2563EB 0%, #38BDF8 100%);
  box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.3);
}

.light-mode .feature-container {
  background: transparent;
  border: none;
}

.light-mode .feature-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 10px 18px rgba(148, 163, 184, 0.16);
  color: #1E293B;
}

.light-mode .feature-item:hover,
.light-mode .feature-item:focus-within {
  box-shadow: 0 14px 24px rgba(148, 163, 184, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
}

.light-mode .feature-item a {
  color: inherit;
}

.light-mode .feature-visual {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(191, 219, 254, 0.8);
  box-shadow: none;
}

.light-mode .feature-icon {
  filter: none;
}

.light-mode .feature-name {
  color: #0F172A;
}

.light-mode .feature-desc {
  color: rgba(30, 41, 59, 0.75);
}

.light-mode .navigation-bar {
  background-color: #FFFFFF;
  border-top: none;
  box-shadow: none;
}

.light-mode #model-selection {
  background-color: #FFFFFF;
  color: #1A202C;
  border: 1px solid #CBD5E0;
}

.light-mode #image-upload-label,
.light-mode #newchat-label,
.light-mode #params-label,
.light-mode #tools-label {
  background-color: #fafcff;
  color: #1A202C;
}

.light-mode #image-upload-label svg,
.light-mode #newchat-label svg,
.light-mode #params-label svg,
.light-mode #tools-label svg {
  stroke: #4A5568;
}

.light-mode .image-preview-area {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 45px rgba(148, 163, 184, 0.25);
  color: #1F2937;
}


.light-mode .shortcut-menu {
  background-color: #FFFFFF;
  border: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.light-mode .model-params {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 45px rgba(148, 163, 184, 0.25);
  color: #1F2937;
}

.light-mode .model-params h2 {
  color: #1F2937;
}

.light-mode .params-item + .params-item {
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.light-mode .params-item label {
  color: #1F2937;
}

.light-mode .params-item input[type="number"] {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #1A202C;
  box-shadow: 0 1px 2px rgba(148, 163, 184, 0.15) inset;
}

.light-mode .params-item input[type="number"]:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
  background: rgba(255, 255, 255, 0.98);
}

.light-mode .img-container {
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.light-mode .img-container:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

.light-mode .uploaded-image-preview {
  background: rgba(255, 255, 255, 0.95);
}

.light-mode .delete-image-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.45);
  stroke: #DC2626;
}

.light-mode .tool-store {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 45px rgba(148, 163, 184, 0.25);
  color: #1F2937;
}

.light-mode .toolbox-header h2 {
  color: #1F2937;
}

.light-mode .tool-item {
  background: rgba(241, 245, 249, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.6);
}

.light-mode .tool-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
}

.light-mode .tool-icon {
  background: linear-gradient(140deg, rgba(191, 219, 254, 0.9), rgba(199, 210, 254, 0.9));
  box-shadow: 0 10px 20px rgba(148, 163, 184, 0.2);
}

.light-mode .tool-name {
  color: #1F2937;
}

.light-mode .tool-description {
  color: #4B5563;
}

.light-mode .toggle-indicator {
  background: rgba(148, 163, 184, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.light-mode .tool-toggle input:checked + .toggle-indicator {
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  border-color: rgba(79, 70, 229, 0.75);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.3);
}

.light-mode .shortcut-menu div {
  color: #1A202C;
}

.light-mode .shortcut-menu div:hover {
  background-color: #F7FAFC;
}

.light-mode .shortcut-menu svg {
  stroke: #4A5568;
}

.light-mode .shortcut-text-span {
  color: #1A202C;
}

.light-mode .user-message {
  color: #2D3748;
}

.light-mode .icon-copy {
  color: rgba(45, 55, 72, 0.7);
}

.light-mode .icon-copy:hover {
  color: #2D3748;
}

.light-mode .edit-message-btn svg {
  color: #4A5568;
}

.light-mode .edit-message-container {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.65), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 20px 30px rgba(148, 163, 184, 0.25);
}

.light-mode .edit-message-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.85));
  color: #fff;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.32);
}

.light-mode .edit-message-title {
  color: #1E293B;
}

.light-mode .edit-message-hint {
  color: rgba(51, 65, 85, 0.72);
}

.light-mode .edit-message-textarea {
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.light-mode .edit-message-textarea::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.light-mode .edit-message-textarea:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.light-mode .edit-message-count {
  color: #1f2937;
}

.light-mode .edit-message-shortcuts {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(30, 64, 175, 0.85);
}

.light-mode .edit-message-meta {
  color: rgba(71, 85, 105, 0.78);
}

.light-mode .save-message-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(14, 165, 233, 0.9));
  color: #fff;
  box-shadow: 0 14px 24px rgba(59, 130, 246, 0.35);
}

.light-mode .cancel-message-btn {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(30, 41, 59, 0.85);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.light-mode .cancel-message-btn:hover {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.5);
}

.light-mode .cancel-message-btn {
  background-color: #E2E8F0;
  color: #4A5568;
}

.light-mode .cancel-message-btn:hover {
  background-color: #CBD5E0;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(203, 213, 224, 0.3);
}

.light-mode .thinking-block {
  border: none;
  box-shadow: 0 1px 3px rgba(66, 153, 225, 0.2);
}

.light-mode .thinking-header {
  border-bottom: 1px solid rgba(66, 153, 225, 0.1);
}

.light-mode .thinking-title,
.light-mode .thinking-icon,
.light-mode .toggle-icon {
  color: #3182CE;
}

.light-mode .thinking-content {
  color: #1A202C;
}

.light-mode .thinking-content code {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode .thinking-content pre {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode .error-message {
  color: #E53E3E;
  border: 1px solid #FEB2B2;
  background-color: #FFF5F5;
}

.light-mode .error-message__title {
  color: #C53030;
}

.light-mode .error-message__detail {
  color: #742A2A;
}

.light-mode .error-message__raw {
  color: rgba(74, 85, 104, 0.85);
}

/* Additional Light Mode Refinements */
.light-mode .navigation-bar {
  border-top: none;
  box-shadow: none;
}

.light-mode .feature-container {
  border: none;
  box-shadow: none;
}

.light-mode .feature-item {
  border: 1px solid #E2E8F0;
  box-shadow: 0 10px 18px rgba(148, 163, 184, 0.16);
}

.light-mode .feature-item:hover,
.light-mode .feature-item:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(148, 163, 184, 0.2);
}

.light-mode .my-extension-content pre,
.light-mode .my-extension-content code {
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.light-mode .thinking-block {
  border: none;
  box-shadow: 0 1px 3px rgba(66, 153, 225, 0.2);
}

.light-mode .thinking-header {
  border-bottom: 1px solid rgba(66, 153, 225, 0.1);
}

.light-mode .user-message:not(:first-of-type) {
  border-top: 1px solid rgba(203, 213, 224, 0.5);
}

.light-mode #model-selection {
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.light-mode .my-extension-dialogue {
  border-top: none;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.light-mode .my-extension-dialogue textarea {
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
}

/* 划词翻译弹窗适配浅色模式 */
.light-mode#fisherai-transpop-id,
.light-mode #fisherai-transpop-content {
  background-color: #FFFFFF;
  color: #1A202C;
  border-color: #E2E8F0;
}

.light-mode#fisherai-transpop-id code,
.light-mode #fisherai-transpop-content code {
  background-color: #F7FAFC;
  color: #1A202C;
  border: 1px solid #E2E8F0;
}

.light-mode#fisherai-transpop-id pre,
.light-mode #fisherai-transpop-content pre {
  background-color: #F7FAFC;
  color: #1A202C;
  border: 1px solid #E2E8F0;
}

.light-mode#fisherai-transpop-id h1, 
.light-mode#fisherai-transpop-id h2, 
.light-mode#fisherai-transpop-id h3, 
.light-mode#fisherai-transpop-id h4,
.light-mode #fisherai-transpop-content h1,
.light-mode #fisherai-transpop-content h2,
.light-mode #fisherai-transpop-content h3,
.light-mode #fisherai-transpop-content h4 {
  color: #2D3748;
}

.light-mode#fisherai-transpop-id a,
.light-mode #fisherai-transpop-content a {
  color: #3182CE;
}

.light-mode#fisherai-transpop-id ul,
.light-mode#fisherai-transpop-id ol,
.light-mode #fisherai-transpop-content ul,
.light-mode #fisherai-transpop-content ol {
  color: #1A202C;
}

/* 思考区块浅色模式适配 */
.light-mode#fisherai-transpop-id .thinking-block,
.light-mode #fisherai-transpop-content .thinking-block {
  background-color: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.light-mode#fisherai-transpop-id .thinking-content,
.light-mode #fisherai-transpop-content .thinking-content {
  color: #1A202C;
}

.light-mode#fisherai-transpop-id .thinking-content code,
.light-mode #fisherai-transpop-content .thinking-content code {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode#fisherai-transpop-id .thinking-content pre,
.light-mode #fisherai-transpop-content .thinking-content pre {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 默认暗色模式下弹窗样式 */
#fisherai-transpop-id,
#fisherai-transpop-content {
  background-color: #1E293B;
  color: #E2E8F0;
  border-color: #4A5568;
}

#fisherai-transpop-id code,
#fisherai-transpop-content code {
  background-color: #2D3748;
  color: #E2E8F0;
  border: 1px solid #4A5568;
}

#fisherai-transpop-id pre,
#fisherai-transpop-content pre {
  background-color: #2D3748;
  color: #E2E8F0;
  border: 1px solid #4A5568;
}

#fisherai-transpop-id h1, 
#fisherai-transpop-id h2, 
#fisherai-transpop-id h3, 
#fisherai-transpop-id h4,
#fisherai-transpop-content h1,
#fisherai-transpop-content h2,
#fisherai-transpop-content h3,
#fisherai-transpop-content h4 {
  color: #90CDF4;
}

#fisherai-transpop-id a,
#fisherai-transpop-content a {
  color: #63B3ED;
}

#fisherai-transpop-id ul,
#fisherai-transpop-id ol,
#fisherai-transpop-content ul,
#fisherai-transpop-content ol {
  color: #E2E8F0;
}

#fisherai-transpop-id .thinking-block,
#fisherai-transpop-content .thinking-block {
  background-color: rgba(66, 153, 225, 0.15);
  border: 1px solid rgba(66, 153, 225, 0.3);
}

#fisherai-transpop-id .thinking-block,
#fisherai-transpop-id .thinking-header,
#fisherai-transpop-id .thinking-content {
  margin: 0;
  border: none;
}

/* 输入容器样式 */
.input-container {
  position: relative;
  flex-grow: 1;
  margin-right: 5px;
}

/* 选中内容标签样式 */
.selected-content-tag {
  position: absolute;
  top: 10px;
  left: 8px;
  background: #374151;
  border: 1px solid #4B5563;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 40px);
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.selected-content-icon {
  display: flex;
  align-items: center;
  color: #9CA3AF;
  flex-shrink: 0;
}

.selected-content-info {
  flex: 1;
  min-width: 0;
}

.selected-content-preview {
  font-size: 12px;
  font-weight: 500;
  color: #E5E7EB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.selected-content-label {
  font-size: 10px;
  color: #9CA3AF;
  margin-top: 1px;
}

.clear-selected-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.clear-selected-btn:hover {
  background-color: #4B5563;
  color: #F9FAFB;
}

/* 当有选中内容时，调整textarea和navigation-bar的位置 */
.input-container.has-selected-content textarea {
  padding-top: 58px !important;
}

/* 当有选中内容时，调整导航栏位置 */
.has-selected-content-active .navigation-bar {
  bottom: 70px !important;
}

/* 浅色模式样式 */
.light-mode .selected-content-tag {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-mode .selected-content-icon {
  color: #6B7280;
}

.light-mode .selected-content-preview {
  color: #374151;
}

.light-mode .selected-content-label {
  color: #6B7280;
}

.light-mode .clear-selected-btn {
  color: #6B7280;
}

.light-mode .clear-selected-btn:hover {
  background-color: #E5E7EB;
  color: #111827;
}

/* 选中内容消息样式 */
.selected-text-message {
  background-color: #1E293B !important;
  border: 1px solid #475569;
  border-radius: 8px;
  margin-bottom: 10px;
}

.selected-text-message .message-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
  margin-bottom: 6px;
  padding: 8px 12px 0;
}

.selected-text-message .message-content {
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #E2E8F0;
  max-height: 150px;
  overflow-y: auto;
  word-wrap: break-word;
}

/* 浅色模式 */
.light-mode .selected-text-message {
  background-color: #F8FAFC !important;
  border: 1px solid #E2E8F0;
}

.light-mode .selected-text-message .message-label {
  color: #64748B;
}

.light-mode .selected-text-message .message-content {
  color: #475569;
}
