/* 依据旧站 base64/index.scss 移植，样式仅作用于工具正文。 */

/* Base64 在线编码解码工具样式 */
.tool-root.base64-tool {
  /* 使用主题色及其变体 */
  --primary-color: var(--Dark, #FF5A00);
  --secondary-color: #FFA366;
  --danger-color: #FF4D4D;
  --warning-color: #FFCC66;
  --info-color: #4D7AFF;
  --text-color: var(--DarkTone, #5E5D5B);
  --border-color: #dcdee2;
  --bg-light: #FFF9F5;
  --bg-highlight: #FFE8D9;
  --radius: 6px;
  --max-width: 1200px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 20px;
  font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  color: var(--text-color);
}

.tool-root.base64-tool * {
  box-sizing: border-box;
}

/* 头部样式 */
.tool-root.base64-tool .base64-tool-header {
  text-align: center;
  margin-bottom: 30px;
}

.tool-root.base64-tool .base64-tool-header h1 {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 500;
}

.tool-root.base64-tool .base64-intro {
  max-width: 800px;
  margin: 0 auto 20px;
}

.tool-root.base64-tool .tool-desc {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.tool-root.base64-tool .tool-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.tool-root.base64-tool .tab-item {
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  background-color: #f5f5f5;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.tool-root.base64-tool .tab-item:hover {
  background-color: #e0e0e0;
}

.tool-root.base64-tool .tab-item.active {
  background-color: var(--bg-highlight);
  color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 500;
}

/* 主体内容区域 */
.tool-root.base64-tool .base64-tool-main {
  background-color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 30px;
}

/* 输入区域样式 */
.tool-root.base64-tool .input-area,
.tool-root.base64-tool .output-area {
  margin-bottom: 20px;
}

.tool-root.base64-tool .input-area label,
.tool-root.base64-tool .output-area label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

/* 文本框样式 */
.tool-root.base64-tool .base64-textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: monospace;
  resize: vertical;
  transition: border-color 0.3s;
}

.tool-root.base64-tool .base64-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 90, 0, 0.2);
}

.tool-root.base64-tool .base64-textarea::placeholder {
  color: #aaa;
}

.tool-root.base64-tool .base64-textarea[readonly] {
  background-color: var(--bg-light);
  cursor: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 操作按钮样式 */
.tool-root.base64-tool .action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 15px;
}

.tool-root.base64-tool .button-group {
  display: flex;
  gap: 10px;
}

.tool-root.base64-tool .action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  color: white;
}

.tool-root.base64-tool .encode-btn {
  background-color: var(--primary-color);
}

.tool-root.base64-tool .encode-btn:hover {
  background-color: #E55000;
}

.tool-root.base64-tool .decode-btn {
  background-color: var(--info-color);
}

.tool-root.base64-tool .decode-btn:hover {
  background-color: #3D62CC;
}

.tool-root.base64-tool .exchange {
  background-color: #9E9E9E;
  padding: 8px 12px;
}

.tool-root.base64-tool .exchange:hover {
  background-color: #7e7e7e;
}

.tool-root.base64-tool .shortcut-hint {
  font-size: 12px;
  color: #888;
}

.tool-root.base64-tool .shortcut-hint kbd {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 4px;
  font-family: monospace;
}

/* 输出区域的额外操作 */
.tool-root.base64-tool .output-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tool-root.base64-tool .auto-select {
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.tool-root.base64-tool .auto-select input {
  margin-right: 5px;
}

.tool-root.base64-tool .copy-btn {
  padding: 4px 12px;
  background-color: var(--info-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.tool-root.base64-tool .copy-btn:hover {
  background-color: #3D62CC;
}

.tool-root.base64-tool .copy-btn:active {
  transform: scale(0.95);
}

/* 文件上传区域 */
.tool-root.base64-tool .file-upload-area {
  margin-top: 30px;
  padding: 20px;
  background-color: var(--bg-light);
  border-radius: var(--radius);
}

.tool-root.base64-tool .upload-section p {
  margin-top: 0;
  margin-bottom: 15px;
}

.tool-root.base64-tool .file-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-root.base64-tool .file-input {
  display: none;
}

.tool-root.base64-tool .file-input-label {
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.3s;
}

.tool-root.base64-tool .file-input-label:hover {
  background-color: #E55000;
}

.tool-root.base64-tool .file-name {
  font-size: 14px;
  color: #888;
}

/* Base64 编程信息区域 */
.tool-root.base64-tool .base64-info {
  margin-top: 40px;
}

.tool-root.base64-tool .base64-info h2 {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 500;
}

.tool-root.base64-tool .code-examples-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 15px;
}

.tool-root.base64-tool .language-tab {
  padding: 8px 16px;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  top: 1px;
}

.tool-root.base64-tool .language-tab:hover {
  background-color: #f5f5f5;
}

.tool-root.base64-tool .language-tab.active {
  background-color: #fff;
  border-color: var(--border-color);
  border-bottom-color: #fff;
  color: var(--primary-color);
  font-weight: 500;
}

.tool-root.base64-tool .code-block {
  display: none;
}

.tool-root.base64-tool .code-block.active {
  display: block;
}

.tool-root.base64-tool pre {
  margin: 0;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  overflow: auto;
}

.tool-root.base64-tool pre code {
  font-family: Consolas, Monaco, "Andale Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* 设置弹窗 */
.tool-root.base64-tool .settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.tool-root.base64-tool .settings-modal.active {
  display: flex;
}

.tool-root.base64-tool .settings-content {
  background-color: #fff;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tool-root.base64-tool .settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--bg-highlight);
  border-bottom: 1px solid var(--border-color);
}

.tool-root.base64-tool .settings-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 500;
}

.tool-root.base64-tool .close-settings {
  cursor: pointer;
  font-size: 24px;
  color: #888;
}

.tool-root.base64-tool .close-settings:hover {
  color: #555;
}

.tool-root.base64-tool .settings-body {
  padding: 20px;
  overflow-y: auto;
}

.tool-root.base64-tool .setting-group {
  margin-bottom: 25px;
}

.tool-root.base64-tool .setting-group:last-child {
  margin-bottom: 0;
}

.tool-root.base64-tool .setting-group h3 {
  font-size: 16px;
  margin: 0 0 15px;
  font-weight: 500;
  color: var(--text-color);
}

.tool-root.base64-tool .radio-option,
.tool-root.base64-tool .checkbox-option {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  margin-bottom: 8px;
  cursor: pointer;
}

.tool-root.base64-tool .radio-option input,
.tool-root.base64-tool .checkbox-option input {
  margin-right: 5px;
}

.tool-root.base64-tool .charset-note,
.tool-root.base64-tool .auto-note,
.tool-root.base64-tool .shortcut-note,
.tool-root.base64-tool .format-note,
.tool-root.base64-tool .replace-note {
  margin-top: 10px;
  font-size: 13px;
  color: #888;
  line-height: 1.4;
}

.tool-root.base64-tool .shortcut-combo,
.tool-root.base64-tool .alternate-shortcut {
  margin-bottom: 8px;
}

.tool-root.base64-tool .shortcut-key {
  display: inline-block;
  padding: 2px 6px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}

.tool-root.base64-tool .symbol-input {
  width: 30px;
  text-align: center;
  padding: 2px;
  margin: 0 5px;
}

.tool-root.base64-tool .symbol-text {
  display: inline-block;
  width: 20px;
  text-align: center;
  font-family: monospace;
}

.tool-root.base64-tool .non-text-spacing {
  margin-top: 10px;
}

/* 底部横幅 */
.tool-root.base64-tool .sponsor-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #f5f5f5;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-root.base64-tool .sponsor-info {
  color: #888;
}

.tool-root.base64-tool .sponsor-info a {
  color: inherit;
  text-decoration: none;
}

.tool-root.base64-tool .sponsor-info a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.tool-root.base64-tool .right-links {
  display: flex;
  align-items: center;
  gap: 15px;
}

.tool-root.base64-tool .docs-link {
  color: var(--primary-color);
  text-decoration: none;
}

.tool-root.base64-tool .docs-link:hover {
  text-decoration: underline;
}

.tool-root.base64-tool .settings-btn {
  padding: 5px 10px;
  background-color: var(--bg-highlight);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
}

.tool-root.base64-tool .settings-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* 响应式样式调整 */
@media screen and (max-width: 729px) {
  .tool-root.base64-tool .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .tool-root.base64-tool .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .tool-root.base64-tool .exchange-btn {
    text-align: center;
  }
  .tool-root.base64-tool .shortcut-hint {
    text-align: center;
  }
  .tool-root.base64-tool .sponsor-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .tool-root.base64-tool .right-links {
    margin-top: 10px;
    width: 100%;
    justify-content: space-between;
  }
}

.tool-root.base64-tool { --Dark: var(--tool-accent, #ff5a00); --DarkTone: #5e5d5b; --layout-max-width: 1200px; --content-padding: 20px; box-sizing: border-box; margin-left: auto; margin-right: auto; }
.tool-root.base64-tool *, .tool-root.base64-tool *::before, .tool-root.base64-tool *::after { box-sizing: border-box; }
.tool-root.base64-tool [hidden] { display: none !important; }
.tool-root.base64-tool .settings-modal[hidden] { display: none !important; }
.tool-root.base64-tool .settings-modal:not([hidden]) { display: flex; }
.tool-root.base64-tool .code-block:not(.active) { display: none; }
.tool-root.base64-tool [data-feedback] { color: #277148; }
.tool-root.base64-tool [data-feedback].error { color: #b42318; }
@media (max-width: 480px) { .tool-root.base64-tool .tool-tabs { flex-wrap: wrap; } }
.tool-root.base64-tool pre { max-width: 100%; overflow-x: auto; }
