/* ========================================
   Olfactory Platform - 分子对接平台样式
   ======================================== */

:root {
  --primary: #5a9a6f;
  --primary-dark: #3d7a4f;
  --primary-light: #c5e4cc;
  --secondary: #7a9e7e;
  --success: #5a7d96;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0ea5e9;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px -6px rgba(0,0,0,0.12);
  --radius: 8px;
  --transition: all 0.35s ease;
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--light);
  color: #1e293b;
  line-height: 1.6;
}

/* 导航栏 */
.navbar {
  background: #b8d4be;
  color: #1e293b;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {

  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.navbar-brand {
  font-size: 1.6rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand:hover {
  color: var(--primary-dark);
}

.navbar-nav {
  display: flex;
  gap: 2px;
  list-style: none;
}

.navbar-nav a {
  color: #000;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  transition: all 0.15s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--primary-dark);
  background: rgba(136, 153, 176, 0.12);
}

/* 主容器 */
.container {
  
  margin: 0 auto;
  padding: 24px;
}

/* 页面标题 */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--secondary);
}

/* 卡片 */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* 功能卡片 */
.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.feature-card p {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.feature-card .link {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.8rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(136, 153, 176, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* 文件上传 */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  transition: border-color 0.2s, background 0.25s;
  cursor: pointer;
}

.file-upload:hover {
  border-color: var(--primary);
  background: rgba(136, 153, 176, 0.05);
}

.file-upload input {
  display: none;
}

.file-upload-icon {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 12px;
}

/* 表格 */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:hover {
  background: var(--light);
}

.table .actions {
  display: flex;
  gap: 8px;
}

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: #dfe6f0;
  color: #4a5e73;
}

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

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* 3D 查看器容器 */
.viewer-container {
  background: #0f172a;
  border-radius: var(--radius);
  height: 400px;
  position: relative;
}

.viewer-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.viewer-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
}

.viewer-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* 步骤条 */
.steps {
  display: flex;
  margin-bottom: 32px;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}

.step:last-child::after {
  display: none;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
  z-index: 1;
}

.step.active .step-number,
.step.completed .step-number {
  background: var(--primary);
  color: white;
}

.step.completed::after {
  background: var(--primary);
}

.step-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--secondary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--secondary);
  margin-bottom: 28px;
}

/* 响应式 */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

  .navbar-nav {
    width: 100%;
    margin-top: 12px;
    overflow-x: auto;
  }

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

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.9);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 进度条 */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.tab-content {
  display: none;
}

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