/* ============================================
   Think 框架官网 - 主样式表
   ============================================ */

:root {
  --primary: #1677FF;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --bg: #F5F6FA;
  --bg-white: #ffffff;
  --text: #1f1f1f;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
  --header-height: 64px;
  --font-mono: 'Courier New', Courier, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Header
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary);
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.header-logo:hover {
  color: #fff;
  opacity: 0.9;
}

.header-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  transition: var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.header-nav .nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  padding: 120px 24px 80px;
  background: linear-gradient(135deg, #1677FF 0%, #4096ff 50%, #69b1ff 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #f0f5ff;
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 6px;
}

/* ============================================
   Stats Section
   ============================================ */

.stats {
  padding: 60px 24px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-item {
  padding: 16px;
}

.stat-number {
  font-size: 40px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ============================================
   Section Common
   ============================================ */

.section {
  padding: 80px 24px;
}

.section-gray {
  background: var(--bg);
}

.section-white {
  background: var(--bg-white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 48px;
}

/* ============================================
   Framework Cards
   ============================================ */

.frameworks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.framework-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
  display: block;
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

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

.framework-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: var(--transition);
}

.framework-card:hover::before {
  background: var(--primary);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.card-icon.python {
  background: #e6f7ff;
  color: #1677FF;
}

.card-icon.java {
  background: #fff7e6;
  color: #fa8c16;
}

.card-icon.cloud {
  background: #f6ffed;
  color: #52c41a;
}

.card-icon.ai {
  background: #f9f0ff;
  color: #722ed1;
}

.card-icon.java-ai {
  background: #fff0f6;
  color: #eb2f96;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.badge-python {
  background: #e6f7ff;
  color: #1677FF;
}

.badge-java {
  background: #fff7e6;
  color: #fa8c16;
}

.badge-cloud {
  background: #f6ffed;
  color: #52c41a;
}

.badge-ai {
  background: #f9f0ff;
  color: #722ed1;
}

.badge-java-ai {
  background: #fff0f6;
  color: #eb2f96;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.card-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
}

.card-footer .repo-links {
  display: flex;
  gap: 12px;
}

.card-footer .repo-links a {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-footer .repo-links a:hover {
  color: var(--primary);
}

/* ============================================
   Features
   ============================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-item {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--primary-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.feature-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Tech Comparison Table
   ============================================ */

.tech-table-wrapper {
  overflow-x: auto;
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tech-table th,
.tech-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.tech-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-table td:first-child {
  font-weight: 600;
}

.tech-table tr:hover td {
  background: var(--primary-light);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: #1f1f1f;
  color: rgba(255, 255, 255, 0.65);
  padding: 60px 24px 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand {
  font-size: 14px;
  line-height: 1.8;
}

.footer-brand .footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  display: block;
  padding: 4px 0;
  transition: var(--transition);
}

.footer a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 13px;
}

/* ============================================
   Framework Detail Page
   ============================================ */

.framework-hero {
  padding: 100px 24px 60px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.framework-hero.python { background: linear-gradient(135deg, #1677FF 0%, #4096ff 100%); }
.framework-hero.java { background: linear-gradient(135deg, #fa8c16 0%, #ffa940 100%); }
.framework-hero.cloud { background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%); }
.framework-hero.ai-purple { background: linear-gradient(135deg, #722ed1 0%, #9254de 100%); }
.framework-hero.ai-pink { background: linear-gradient(135deg, #eb2f96 0%, #f759ab 100%); }

.framework-hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 12px;
}

.framework-hero .subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 24px;
}

.framework-hero .badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.framework-hero .badges img {
  height: 20px;
}

.framework-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  margin-top: 48px;
  margin-bottom: 80px;
}

/* Sidebar */
.framework-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.sidebar-nav {
  list-style: none;
  border-left: 2px solid var(--border);
}

.sidebar-nav li a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: var(--transition);
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

/* Main Content */
.framework-main h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.framework-main h2:first-child {
  margin-top: 0;
}

.framework-main h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.framework-main p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.framework-main ul,
.framework-main ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.framework-main li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Code Block */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 16px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.code-block .lang-tag {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
}

.code-block code {
  font-family: var(--font-mono);
  white-space: pre;
  display: block;
}

/* Info Card */
.info-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 16px 0;
  border-left: 4px solid var(--primary);
}

.info-card.warning {
  border-left-color: #faad14;
}

.info-card.tip {
  border-left-color: #52c41a;
}

.info-card-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-card p {
  font-size: 14px;
  margin-bottom: 0;
}

/* Feature Table */
.feature-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

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

.feature-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 13px;
}

.feature-table tr:nth-child(even) td {
  background: #fafafa;
}

/* Module Grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.module-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border-light);
}

.module-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary);
}

.module-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.4);
}

/* ============================================
   Responsive
   ============================================ */

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

  .framework-content {
    grid-template-columns: 1fr;
  }

  .framework-sidebar {
    display: none;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 15px;
  }

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

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

  .header-nav {
    display: none;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 16px;
    box-shadow: var(--shadow-lg);
  }

  .header-mobile-toggle {
    display: block;
  }

  .section-title {
    font-size: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 48px 16px;
  }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ============================================
   Print
   ============================================ */

@media print {
  .header, .footer, .back-to-top, .framework-sidebar {
    display: none;
  }

  .framework-content {
    display: block;
  }

  body {
    background: #fff;
  }
}