/* ===== AI创业教练 · Vibe Code Pro ===== */
:root {
  --bg-deep: #0a0a1a;
  --bg-panel: rgba(22, 22, 45, 0.8);
  --bg-card: rgba(30, 30, 60, 0.6);
  --border: rgba(120, 100, 255, 0.15);
  --border-glow: rgba(120, 100, 255, 0.35);
  --text: #e8e8f5;
  --text-dim: #8b8ba7;
  --text-mute: #5c5c7a;
  --primary: #7c5cff;
  --primary-light: #a084ff;
  --secondary: #00c6ff;
  --accent: #ff6ec7;
  --success: #00e396;
  --warning: #feb019;
  --gradient: linear-gradient(135deg, #7c5cff 0%, #00c6ff 100%);
  --gradient-pink: linear-gradient(135deg, #ff6ec7 0%, #7c5cff 100%);
  --gradient-card: linear-gradient(145deg, rgba(124,92,255,0.08) 0%, rgba(0,198,255,0.04) 100%);
  --shadow-glow: 0 0 40px rgba(124, 92, 255, 0.15);
  --radius: 16px;
}

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

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* 背景动效 */
body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 20% 30%, rgba(124,92,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(0,198,255,0.06) 0%, transparent 50%);
  animation: drift 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, 1%); }
}

.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(124,92,255,0.4);
}
.logo-text h1 { font-size: 16px; font-weight: 700; }
.logo-sub { font-size: 11px; color: var(--text-mute); }

.nav { flex: 1; padding: 0 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 4px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text);
}
.nav-item.active {
  background: var(--gradient-card);
  color: var(--text);
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 24px;
  background: var(--gradient);
  border-radius: 0 4px 4px 0;
}
.nav-icon { font-size: 18px; }

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--gradient-pink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.user-name { font-size: 12px; color: var(--text-dim); }

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-left h2 { font-size: 20px; font-weight: 700; }
.topbar-desc { font-size: 13px; color: var(--text-mute); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(0,227,150,0.1);
  color: var(--success);
  border: 1px solid rgba(0,227,150,0.3);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,92,255,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(124,92,255,0.5);
}
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-glow); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Content ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 24px;
}
.page-header h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.page-header p {
  font-size: 13px;
  color: var(--text-mute);
}

/* ===== Form ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.25s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.1);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
  cursor: pointer;
}
.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}
.card-icon { font-size: 28px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.card-desc { font-size: 12px; color: var(--text-mute); line-height: 1.6; }

/* Feature card with button */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}
.feature-card:hover { border-color: var(--border-glow); }
.feature-card h4 { font-size: 14px; margin-bottom: 8px; }
.feature-card p { font-size: 12px; color: var(--text-mute); margin-bottom: 14px; line-height: 1.6; }

/* ===== Matrix Flow ===== */
.flow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.flow-node {
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.flow-input {
  background: var(--gradient-pink);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,110,199,0.3);
}
.flow-process {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,92,255,0.3);
}
.flow-output {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  color: var(--text);
}
.flow-arrow {
  font-size: 22px;
  color: var(--primary-light);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== Platform Checkboxes ===== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.platform-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
}
.platform-item:hover { border-color: var(--border-glow); }
.platform-item.selected {
  border-color: var(--primary);
  background: rgba(124,92,255,0.08);
}
.platform-item input { display: none; }
.platform-icon { font-size: 20px; }
.platform-name { font-size: 13px; font-weight: 600; }

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-mute);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: rgba(124,92,255,0.03); }

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: rgba(254,176,25,0.15); color: var(--warning); }
.badge-done { background: rgba(0,227,150,0.15); color: var(--success); }
.badge-progress { background: rgba(0,198,255,0.15); color: var(--secondary); }

/* ===== Schedule Grid ===== */
.schedule-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.schedule-cell {
  background: var(--bg-card);
  padding: 10px 8px;
  font-size: 11px;
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule-cell.header {
  background: rgba(124,92,255,0.1);
  font-weight: 700;
  color: var(--text-dim);
}
.schedule-cell.has-task {
  background: rgba(124,92,255,0.08);
  color: var(--primary-light);
  font-weight: 600;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  width: 90%;
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: var(--gradient);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.4s;
  box-shadow: 0 8px 40px rgba(124,92,255,0.4);
}
.toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Toggle Switch ===== */
.toggle {
  position: relative;
  width: 50px; height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.toggle.active { background: var(--gradient); border-color: transparent; }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s;
}
.toggle.active::after { left: 25px; }

/* ===== Knowledge Base ===== */
.kb-area {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}
.kb-area:hover, .kb-area.dragover {
  border-color: var(--primary);
  background: rgba(124,92,255,0.05);
}
.kb-area .kb-icon { font-size: 40px; margin-bottom: 12px; }
.kb-area p { font-size: 14px; color: var(--text-dim); }
.kb-area span { font-size: 12px; color: var(--text-mute); }

.kb-files {
  margin-top: 16px;
}
.kb-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
}
.kb-file-item .file-icon { font-size: 20px; }
.kb-file-item .file-name { flex: 1; font-size: 13px; }
.kb-file-item .file-status { font-size: 11px; color: var(--success); }

/* ===== Generation Animation ===== */
.generating {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  justify-content: center;
}
.gen-dots { display: flex; gap: 6px; }
.gen-dots span {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.gen-dots span:nth-child(2) { animation-delay: 0.15s; }
.gen-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ===== Section Title ===== */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}

/* ===== API Key Input ===== */
.api-config {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 600px;
}
.api-config .form-group:last-child { margin-bottom: 0; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { width: 70px; }
  .logo-text, .nav-item span:not(.nav-icon), .user-name { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}
