* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
}

/* ===== 登录页面 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  padding: 48px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  color: #999;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: #667eea;
}

.login-btn {
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.login-btn:hover {
  opacity: 0.9;
}

/* ===== 主页面 ===== */
.main-page {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: #2c3e50;
  color: white;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(102, 126, 234, 0.3);
  color: white;
  border-left: 3px solid #667eea;
}

.nav-item .icon {
  font-size: 20px;
  margin-right: 12px;
}

.nav-item .text {
  font-size: 14px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.top-bar h1 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info .username {
  font-size: 14px;
  color: #333;
}

.logout-btn {
  padding: 8px 20px;
  font-size: 14px;
  color: #fff;
  background: #f56c6c;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #f78989;
}

/* 页面内容 */
.page-content {
  display: none;
  padding: 32px;
}

.page-content.active {
  display: block;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 48px;
  margin-right: 16px;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #999;
}

/* 数据表格 */
.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #fafafa;
}

.data-table th {
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  text-align: left;
  border-bottom: 1px solid #e1e8ed;
}

.data-table td {
  padding: 16px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #f5f7fa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.status-success {
  background: #e1f3d8;
  color: #67c23a;
}

.status-warning {
  background: #fdf6ec;
  color: #e6a23c;
}

.status-danger {
  background: #fef0f0;
  color: #f56c6c;
}

.status-info {
  background: #f4f4f5;
  color: #909399;
}

.text-danger {
  color: #f56c6c;
  font-weight: 500;
}

/* 操作按钮 */
.action-btn {
  padding: 6px 16px;
  font-size: 12px;
  border: 1px solid #e1f3d8;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
}

.action-btn:last-child {
  margin-right: 0;
}

.btn-danger {
  background: #f56c6c;
  color: white;
  border-color: #f56c6c;
}

.btn-danger:hover {
  background: #e55a50;
  border-color: #e55a50;
}

.btn-success {
  background: #67c23a;
  color: white;
  border-color: #67c23a;
}

.btn-success:hover {
  background: #5a9f32;
  border-color: #5a9f32;
}
  font-size: 13px;
  color: white;
  background: #667eea;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.action-btn:hover {
  background: #5568d3;
}

.action-btn.delete {
  background: #f56c6c;
}

.action-btn.delete:hover {
  background: #f78989;
}

/* 反馈内容预览 */
.feedback-preview {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
}

/* 弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  gap: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 500;
  flex: 1;
}

.modal-env {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.btn {
  padding: 8px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background: #4caf50;
  color: white;
}

.btn-primary:hover {
  background: #45a049;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
}

/* 表单优化 */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.required {
  color: #f44;
  margin-left: 4px;
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

/* 单选按钮组 */
.radio-group {
  display: flex;
  gap: 24px;
  padding: 8px 0;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: #4caf50;
}

.radio-text {
  font-size: 14px;
  color: #333;
}

.radio-label:hover .radio-text {
  color: #4caf50;
}

/* 提示词管理样式 */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

.prompt-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #4caf50;
}

.prompt-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.prompt-icon {
  font-size: 32px;
}

.prompt-info {
  flex: 1;
}

.prompt-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.prompt-env {
  font-size: 12px;
  color: #999;
}

.prompt-preview {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
}

.image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 16px;
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
}

.form-select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  width: auto;
}

.modal-large {
  max-width: 700px;
}

.btn-upload {
  margin-left: 12px;
}

/* 测试结果容器 */
.test-result-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.test-result-json,
.test-result-formatted {
  display: flex;
  flex-direction: column;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e1e8ed;
  font-size: 13px;
  font-weight: 500;
  color: #495057;
}

.toggle-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.test-result-json textarea {
  flex: 1;
  border: none;
  resize: none;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  padding: 12px;
  line-height: 1.6;
}

.test-result-formatted {
  max-height: 400px;
  overflow-y: auto;
}

.formatted-content {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}

/* 格式化内容样式 */
.formatted-content .section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4caf50;
}

.formatted-content .item {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-left: 3px solid #4caf50;
  border-radius: 4px;
}

.formatted-content .item-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
  font-size: 15px;
}

.formatted-content .item-detail {
  margin: 4px 0;
  padding-left: 8px;
  color: #555;
  line-height: 1.6;
}

.formatted-content .item-label {
  font-weight: 500;
  color: #666;
  margin-right: 4px;
}

.formatted-content .number {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: #4caf50;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  margin-right: 8px;
  font-size: 13px;
}

.formatted-content .divider {
  margin: 16px 0;
  border-top: 1px dashed #ddd;
  padding-top: 12px;
}

.formatted-content .subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  margin: 12px 0 8px 0;
}

.formatted-content .example-box {
  background: #e3f2fd;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 6px 0;
  font-style: italic;
  color: #1565c0;
}

/* 测试信息卡片 */
.test-info {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
}

.test-info .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.test-info .info-row:last-child {
  border-bottom: none;
}

.test-info .info-label {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 500;
}

.test-info .info-value {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.test-info .info-value .token-breakdown {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.test-info .info-value .token-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.test-info .info-value .token-total {
  color: #ffd700;
  font-weight: 700;
}

.section-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #4caf50;
}

.image-preview-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-preview-item {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e1e8ed;
  transition: all 0.3s;
}

.image-preview-item:hover {
  border-color: #4caf50;
  transform: scale(1.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

/* 分页样式 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #fafafa;
  border-top: 1px solid #eee;
}

.pagination-info {
  font-size: 14px;
  color: #666;
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  padding: 6px 16px;
  font-size: 14px;
  color: white;
  background: #667eea;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.pagination-btn:hover:not(:disabled) {
  background: #5568d3;
}

.pagination-btn:disabled {
  background: #dcdfe6;
  cursor: not-allowed;
}

/* 使用记录页面的筛选栏样式 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.filter-bar .form-input {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  min-width: 150px;
}

.filter-bar .form-select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  min-width: 140px;
  background: white;
}


.filter-bar .form-input:focus,
.filter-bar .form-select:focus {
  outline: none;
  border-color: #667eea;
}

/* 用户链接样式 */
.user-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  border-bottom: 1px dashed #667eea;
}

.user-link:hover {
  color: #764ba2;
  border-bottom-color: #764ba2;
}

/* 功能类型链接样式 */
.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  background: #f0f4ff;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #e1e8ed;
}

.feature-link:hover {
  color: white;
  background: #667eea;
  border-color: #667eea;
}

.feature-link .link-icon {
  font-size: 12px;
  opacity: 0.7;
}

.feature-link:hover .link-icon {
  opacity: 1;
}

/* 图片预览按钮 */
.preview-image-btn {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.preview-image-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-image-btn:active {
  transform: translateY(0);
}




