/* ===== OpenClaw Training - Main Stylesheet ===== */
/* 简洁大气 · 卡片风格 · 响应式设计 · 🦞 Lobster Vibe */

:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --primary-dark: #0f2744;
  --accent: #38a169;
  --accent-light: #48bb78;
  --warning: #ed8936;
  --danger: #e53e3e;
  --info: #3182ce;
  --lobster: #e53e3e;
  
  --bg-main: #f7fafc;
  --bg-card: #ffffff;
  --bg-code: #f6f8fa;
  --bg-code-header: #eaeef2;
  --bg-mac: #e6fffa;
  --bg-win: #ebf8ff;
  
  --text-main: #2d3748;
  --text-muted: #718096;
  --text-light: #a0aec0;
  
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --border-code: #d0d7de;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-brand .lobster-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--bg-mac);
}

/* ===== Hero Section ===== */
.hero {
  padding: 120px 2rem 60px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
}

.hero-lobster {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.hero-badge {
  display: inline-block;
  padding: 0.375rem 1rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: white;
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-mac);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-light);
}

.card-tag {
  padding: 0.25rem 0.625rem;
  background: var(--bg-mac);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 600;
}

/* ===== Step Cards (Numbered) ===== */
.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.step-number {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.step-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.step-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* ===== Content Cards (for chapters) ===== */
.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.content-card h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
}

.content-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-light);
  margin: 1.5rem 0 0.75rem;
}

.content-card p {
  color: var(--text-main);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.content-card ul, .content-card ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-card li {
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

/* ===== Code Blocks (Light Theme - High Contrast) ===== */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-code);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: var(--bg-code-header);
  border-bottom: 1px solid var(--border-code);
}

.code-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

.code-platform.mac {
  background: #0d9488;
  color: #fff;
}

.code-platform.win {
  background: #2563eb;
  color: #fff;
}

.code-platform.linux {
  background: #c2410c;
  color: #fff;
}

.code-filename {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-weight: 600;
}

.code-block pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #1f2937;
  background: var(--bg-code);
}

.code-block code {
  font-family: inherit;
  background: none;
  padding: 0;
  color: #1f2937;
}

/* Inline code */
code {
  background: #edf2f7;
  color: var(--primary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.9em;
  font-weight: 600;
}

/* ===== Platform Tabs ===== */
.platform-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.platform-tab {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: var(--transition);
}

.platform-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.platform-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Tab Group (for tutorial page) ===== */
.tab-group {
  margin: 1.5rem 0;
}

.tab-header {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--bg-main);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-main);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-panel {
  display: none;
  animation: fadeInUp 0.3s ease-out;
}

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

/* ===== Timeline (for history) ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 16px; height: 16px;
  background: var(--bg-card);
  border: 3px solid var(--primary);
  border-radius: 50%;
}

.timeline-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.timeline-content {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ===== Info Boxes ===== */
.info-box {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.info-box.tip {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #22543d;
}

.info-box.warning {
  background: #fffaf0;
  border: 1px solid #fbd38d;
  color: #7c2d12;
}

.info-box.danger {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #742a2a;
}

.info-box.info {
  background: #ebf8ff;
  border: 1px solid #90cdf4;
  color: #2a4365;
}

.info-box-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.info-box-content {
  flex: 1;
}

.info-box-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

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

.data-table th {
  background: var(--bg-main);
  font-weight: 600;
  color: var(--primary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tr:hover td {
  background: var(--bg-main);
}

/* ===== Footer ===== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 4rem;
  position: relative;
}

.footer-lobster {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.footer p {
  font-size: 0.875rem;
}

/* ===== Page Header ===== */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 100px 2rem 50px;
  color: white;
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '🦞';
  position: absolute;
  right: 2rem;
  bottom: 1rem;
  font-size: 4rem;
  opacity: 0.15;
  transform: rotate(-15deg);
}

.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.page-header p {
  opacity: 0.85;
  max-width: 600px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.breadcrumb a {
  color: white;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ===== Step Navigation (prev/next) ===== */
.step-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.step-nav a {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
}

.step-nav a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.step-nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-nav-title {
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.25rem;
}

.step-nav a.next {
  text-align: right;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .step-card { grid-template-columns: 1fr; }
  .step-number { width: 40px; height: 40px; font-size: 1.125rem; }
  .content-card { padding: 1.5rem; }
  .step-nav { grid-template-columns: 1fr; }
  .hero { padding: 100px 1.5rem 40px; }
  .section { padding: 2.5rem 0; }
  .page-header::after { display: none; }
  .tab-header { overflow-x: auto; }
}

/* ===== Animation ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .content-card, .timeline-item {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
