* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  color: #333;
}
.container {
  width: 100%;
  max-width: 1400px;
}
.app-container {
  width: 100%;
  min-height: 100vh;
  background: #f5f7fa;
}
.app-header {
  background: white;
  border-bottom: 1px solid #e4e7ed;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.logo-section {
  display: flex;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}
.logo i {
  color: #667eea;
  font-size: 20px;
}
.header-actions {
  display: flex;
  gap: 8px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f7fa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  color: #606266;
}
.btn-icon:hover {
  background: #e4e7ed;
  color: #667eea;
}
.app-tabs {
  background: white;
  border-bottom: 1px solid #e4e7ed;
  padding: 0 24px;
  display: flex;
  gap: 8px;
}
.tab {
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  color: #606266;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab:hover {
  color: #667eea;
}
.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-header {
  background: white;
  padding: 20px 24px;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}
.page-actions {
  display: flex;
  gap: 8px;
}
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-primary {
  background: #667eea;
  color: white;
}
.btn-primary:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}
.btn-success {
  background: #67c23a;
  color: white;
}
.btn-success:hover {
  background: #529b2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(103, 194, 58, 0.3);
}
.btn-danger {
  background: #f56c6c;
  color: white;
}
.btn-danger:hover {
  background: #e64949;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 108, 108, 0.3);
}
.btn-secondary {
  background: #f5f7fa;
  color: #606266;
  border: 1px solid #dcdfe6;
}
.btn-secondary:hover {
  background: #e4e7ed;
  border-color: #c0c4cc;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-in-out;
}
.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-in-out;
}

/* 预览模态框特定样式 */
#previewModal .modal-content {
  max-width: 1200px;
  max-height: 95vh;
}

/* 模式切换按钮样式 */
.mode-switch {
  display: flex;
  gap: 4px;
}

.mode-switch .btn {
  border-radius: 6px;
  transition: all 0.3s ease;
}

.mode-switch .btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.mode-switch .btn:not(.active):hover {
  background: #e4e7ed;
  border-color: #c0c4cc;
}

/* 源码模式样式优化 */
#previewSource {
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 2;
  background: #f8f9fa;
  border: 1px solid #e4e7ed;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e4e7ed;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}
.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #909399;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s;
}
.close-btn:hover {
  background: #f5f7fa;
  color: #606266;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
  color: #606266;
  background: white;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-group.checkbox-group {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 8px !important;
  margin-bottom: 16px !important;
}

.form-group.checkbox-group > label:first-child {
  margin-bottom: 0 !important;
  font-weight: 400 !important;
  color: #666 !important;
  flex: 0 0 auto !important;
}

.form-group.checkbox-group > label.switch {
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
}
.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

/* 消息提示样式 */
.message-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease-in-out;
}

.message-toast.success {
  background: #67c23a;
}

.message-toast.error {
  background: #f56c6c;
}

.message-toast.warning {
  background: #e6a23c;
}

.message-toast.info {
  background: #667eea;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 修复开关布局 - 更通用的选择器 */
.form-group.checkbox-group {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}

.form-group.checkbox-group > label:first-child {
  margin-bottom: 0 !important;
  font-weight: 400 !important;
  color: #666 !important;
  flex: 1 !important;
}

.form-group.checkbox-group > label.switch {
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

/* 确认框样式 */
.confirm-modal {
  display: none;
  position: fixed;
  z-index: 1500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-in-out;
}

.confirm-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 400px;
  animation: slideIn 0.3s ease-in-out;
}

.confirm-header {
  padding: 20px 20px 0;
  text-align: center;
}

.confirm-icon {
  font-size: 48px;
  color: #f56c6c;
  margin-bottom: 16px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.confirm-message {
  color: #666;
  margin-bottom: 24px;
}

.confirm-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 20px 20px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background: #667eea;
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.action-buttons {
  display: flex;
  gap: 8px;
}

/* 设置模态框样式 */
.settings-modal .modal-body {
  padding: 0;
  overflow: hidden;
}

.settings-tabs {
  display: flex;
  background-color: #f5f7fa;
  border-bottom: 1px solid #e4e7ed;
}

.settings-tab {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #606266;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-tab:hover {
  color: #667eea;
}

.settings-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background-color: white;
}

.settings-content {
  padding: 20px;
  display: none;
  overflow-y: auto;
  flex-grow: 1;
}

.settings-content.active {
  display: block;
}

.settings-content .form-group {
  margin-bottom: 16px;
}

.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s;
  color: #606266;
  background: white;
  resize: vertical;
  min-height: 80px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(102, 126, 234, 0.1);
  border-left-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* 为remixicon的loader图标添加旋转动画 */
.ri-loader-4-line {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Markdown预览样式 */
#previewContent {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  line-height: 1.6;
  color: #333;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 确保所有内容不超出预览框 */
#previewContent * {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* 处理图片 */
#previewContent img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 10px auto;
}

/* 处理表格 */
#previewContent table {
  width: 100% !important;
  overflow-x: auto;
  display: block;
  margin-bottom: 15px;
}

/* 处理长代码行 */
#previewContent code {
  overflow-wrap: break-word;
  word-break: break-word;
}

#previewContent pre {
  overflow-x: auto;
  white-space: pre;
  word-wrap: normal;
}

#previewContent h1,
#previewContent h2,
#previewContent h3,
#previewContent h4,
#previewContent h5,
#previewContent h6 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #2c3e50;
}

#previewContent p {
  margin-bottom: 10px;
}

#previewContent ul,
#previewContent ol {
  margin-bottom: 10px;
  padding-left: 20px;
}

#previewContent li {
  margin-bottom: 5px;
}

#previewContent code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

#previewContent pre {
  background: #e9ecef;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 15px;
}

#previewContent pre code {
  background: transparent;
  padding: 0;
}

#previewContent blockquote {
  border-left: 4px solid #667eea;
  margin: 0;
  padding-left: 15px;
  color: #6c757d;
  margin-bottom: 15px;
}
