/* public/css/style.css - 医疗内容合规生成平台 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8fafc;
  height: 100vh;
  overflow: hidden;
  color: #334155;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 顶部导航栏样式 */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.5rem;
  color: white;
}

.logo-section h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.username {
  font-weight: 500;
}

.lang-switch {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 主容器布局 */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.125rem 0.75rem;
  border-radius: 0.5rem;
  color: #64748b;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: #0ea5e9;
}

.nav-item.active {
  background-color: #0ea5e9;
  color: white;
}

.nav-item i {
  margin-right: 0.75rem;
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.nav-section-title {
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 1rem;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background-color: #f8fafc;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
}

/* 控制台页面样式 */
.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
}

.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-radius: 1rem;
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.welcome-section h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.welcome-section p {
  font-size: 1rem;
  opacity: 0.9;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.action-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.action-card i {
  font-size: 2rem;
  color: #0ea5e9;
  margin-bottom: 1rem;
}

.action-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.action-card p {
  font-size: 0.875rem;
  color: #64748b;
}

.recent-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1e293b;
}

.content-list {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.content-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.content-item:last-child {
  border-bottom: none;
}

.content-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #1e293b;
}

.content-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.type-tag,
.platform-tag {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.type-tag.doctor {
  background: #dbeafe;
  color: #1d4ed8;
}

.type-tag.influencer {
  background: #fef3c7;
  color: #d97706;
}

.platform-tag {
  background: #f1f5f9;
  color: #475569;
}

.date {
  color: #64748b;
  font-size: 0.875rem;
}

.content-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.content-status.status-passed {
  background: #dcfce7;
  color: #166534;
}

.content-status.status-warning {
  background: #fef3c7;
  color: #92400e;
}

/* 生成表单样式 */
.generation-form {
  max-width: 800px;
  margin-bottom: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1e293b;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.generate-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.generate-btn:hover {
  opacity: 0.9;
}

/* 病名选择器样式 */
.disease-selector {
  position: relative;
}

.selected-diseases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.disease-tag {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.disease-tag i {
  cursor: pointer;
  font-size: 0.75rem;
}

.disease-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.disease-item {
  background: #f1f5f9;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.disease-item:hover {
  background: #e2e8f0;
}

/* 素人人设选择样式 */
.influencer-personas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.persona-option {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.persona-option:hover {
  border-color: #0ea5e9;
}

.persona-option.active {
  border-color: #0ea5e9;
  background: #dbeafe;
}

.persona-option i {
  font-size: 1.5rem;
  color: #0ea5e9;
  margin-bottom: 0.5rem;
}

.persona-option span {
  font-size: 0.875rem;
  color: #1e293b;
}

/* 生成结果样式 */
.generation-results {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.generation-results h3 {
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.tab:hover {
  color: #0ea5e9;
}

.tab.active {
  color: #0ea5e9;
  border-bottom: 2px solid #0ea5e9;
  background: white;
}

.result-content {
  display: none;
  padding: 1.5rem;
}

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

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.result-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

.copy-btn,
.export-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.copy-btn:hover,
.export-btn:hover {
  background: #e2e8f0;
}

.content-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.verification-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.verification-status.status-passed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.verification-status.status-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* 管理页面表格样式 */
.management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.management-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

.filter-section {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.content-table,
.rules-table,
.diseases-table,
.users-table {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

tr:last-child td {
  border-bottom: none;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.passed {
  background: #dcfce7;
  color: #166534;
}

.status-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.role-tag.admin {
  background: #fee2e2;
  color: #b91c1c;
}

.role-tag.editor {
  background: #ffedd5;
  color: #c2410c;
}

.risk-level.low {
  background: #dcfce7;
  color: #166534;
}

.risk-level.medium {
  background: #fef3c7;
  color: #92400e;
}

.risk-level.high {
  background: #fee2e2;
  color: #b91c1c;
}

.action-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
  margin-right: 0.25rem;
}

.action-btn:hover {
  background: #f1f5f9;
}

.view-btn {
  color: #0ea5e9;
  border-color: #0ea5e9;
}

.edit-btn {
  color: #f59e0b;
  border-color: #f59e0b;
}

.delete-btn {
  color: #ef4444;
  border-color: #ef4444;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #1e293b;
  font-weight: 600;
}

.close {
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: #94a3b8;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.close:hover {
  background: #f1f5f9;
  color: #334155;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 0 0 0.75rem 0.75rem;
}

.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: #64748b;
  color: white;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-outline {
  background: white;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-outline:hover {
  background: #f1f5f9;
}

/* 内容校验结果弹窗样式 */
.verification-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.verification-result.warning {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  color: #92400e;
}

.verification-result.warning i {
  font-size: 1.5rem;
  color: #f59e0b;
}

.issue-section,
.suggestion-section {
  margin-bottom: 1rem;
}

.issue-section ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.issue-section li {
  margin-bottom: 0.5rem;
  color: #dc2626;
}

.suggestion-section p {
  background: #eff6ff;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
  color: #1e40af;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .top-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .content-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .result-actions {
    align-self: flex-end;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .management-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* 滚动条样式 */
.main-content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.main-content::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 60px;
  }

  .conversations-list {
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }

  .conversation-item {
    min-width: 150px;
    margin: 0 5px;
  }

  .chat-container {
    height: calc(100vh - 60px);
  }

  .suggestions {
    grid-template-columns: 1fr;
  }
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar,
.conversations-list::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}