/* ==================== SillyTavern 风格系统设置 ==================== */

.settings-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

/* 消息提示 */
.message {
  margin: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid #4caf50;
  color: #66bb6a;
}

.message.error {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid #f44336;
  color: #ef5350;
}

/* ==================== 左右分栏布局 ==================== */
.settings-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧边栏 - 垂直标签 */
.settings-sidebar {
  width: 180px;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  text-align: left;
}

.sidebar-tab:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.sidebar-tab.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
}

.tab-icon {
  font-size: 16px;
  line-height: 1;
}

.tab-label {
  flex: 1;
}

/* 右侧主内容区 */
.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ==================== 设置面板 ==================== */
.settings-panel {
  max-width: 800px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.panel-header h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.panel-description {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ==================== 设置分组 ==================== */
.settings-group {
  margin-bottom: 20px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.group-title {
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 设置行 */
.setting-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
  gap: 12px;
}

.setting-row:last-child {
  border-bottom: none;
}

.row-label {
  min-width: 120px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.row-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 输入框 */
.text-input,
.file-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 13px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.text-input:focus,
.file-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.hint-text {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* 路径代码 */
.path-code {
  display: inline-block;
  padding: 6px 10px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: var(--color-accent);
}

/* 文件结构列表 */
.file-structure-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
}

.file-structure-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-icon {
  font-size: 14px;
}

/* 预览容器 */
.preview-container {
  padding: 14px;
}

.preview-section {
  margin-bottom: 12px;
}

.preview-section:last-child {
  margin-bottom: 0;
}

.preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.preview-code {
  padding: 10px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: var(--color-text-primary);
  line-height: 1.6;
  word-break: break-all;
}

.preview-code.processed {
  background: rgba(76, 175, 80, 0.05);
  border-color: rgba(76, 175, 80, 0.3);
  color: #66bb6a;
}

/* 操作按钮组 */
.actions-group {
  padding: 14px;
  background: var(--color-bg-tertiary);
  border-top: 1px solid var(--color-border);
}

.btn-save {
  padding: 10px 20px;
  background: var(--color-accent);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-save:hover:not(:disabled) {
  background: var(--color-accent-hover, #5a67d8);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-save:active:not(:disabled) {
  transform: translateY(0);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-action {
  padding: 8px 14px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
