/* ============================================
   DeepKit 深工坊 - Main Stylesheet
   Notion-inspired design system
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #FFFFFF;
  --bg-card: #F7F6F3;
  --text-primary: #37352F;
  --text-secondary: #787774;
  --border-color: #E3E2DE;
  --shadow-hover: 0 8px 24px rgba(55, 53, 47, 0.12);
  --shadow-card: 0 1px 3px rgba(55, 53, 47, 0.06);
  --radius-card: 12px;
  --radius-badge: 6px;
  --transition: 0.2s ease;

  /* Price tier colors */
  --price-high: #E8590C;
  --price-mid: #2EAADC;
  --price-free: #4DAB9A;
  --price-enterprise: #9B59B6;
  --price-foundation: #787774;

  /* Accent */
  --accent: #2EAADC;
  --accent-hover: #2596be;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Layout Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
}

.hero-tags {
  font-size: 15px;
  color: var(--text-secondary);
  opacity: 0.8;
  letter-spacing: 2px;
}

/* --- Products Section --- */
.products {
  padding: 40px 0 80px;
}

.products-header {
  text-align: center;
  margin-bottom: 48px;
}

.products-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Masonry / Waterfall Grid */
.products-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.products-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Product Card --- */
.product-card {
  display: block;
  text-decoration: none;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
}

.product-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-hover);
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.card-title {
  display: flex;
  flex-direction: column;
}

.card-name-en {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-name-cn {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.card-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Card Features */
.card-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-features li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.card-features li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  text-align: center;
}

.footer-content {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-content a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-content a:hover {
  color: var(--text-primary);
}

.footer-divider {
  color: var(--border-color);
}

/* ============================================
   Product Sub-Pages
   ============================================ */

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 24px 0 0;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text-primary);
}

/* Product Hero */
.product-hero {
  text-align: center;
  padding: 60px 24px 48px;
}

.product-hero .product-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin: 0 auto 24px;
}

.product-hero .product-name-en {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.product-hero .product-name-cn {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.product-hero .product-tagline {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Content Sections */
.product-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
}

.product-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.product-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 24px;
}

.product-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.product-section ul {
  list-style: none;
  padding: 0;
}

.product-section ul li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 20px;
  position: relative;
}

.product-section ul li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.feature-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px;
}

.feature-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Pricing Section */
.pricing-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
}

.pricing-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.pricing-table th,
.pricing-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.pricing-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
}

.pricing-table td {
  color: var(--text-secondary);
}

.pricing-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.pricing-card .price-note {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.pricing-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.pricing-cards-row .pricing-card {
  max-width: none;
}

.pricing-card .plan-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* CTA Buttons */
.cta-button {
  display: inline-block;
  padding: 14px 32px;
  background: var(--text-primary);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
  text-align: center;
}

.cta-button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.cta-button.cta-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.cta-button.cta-secondary:hover {
  background: var(--border-color);
  opacity: 1;
}

.cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  font-weight: 600;
  background: var(--bg-card);
}

.comparison-table td:first-child,
.comparison-table th:first-child {
  text-align: left;
}

/* Architecture text block */
.arch-block {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Module list */
.module-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.module-item {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Badge */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-badge);
  color: white;
  background: var(--price-free);
}

.badge-enterprise {
  background: var(--price-enterprise);
}

/* Screenshots */
.screenshot-main {
  margin-bottom: 16px;
}

.screenshot-main img {
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.screenshot-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .screenshot-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .products-grid {
    flex-direction: column;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .product-card {
    padding: 20px;
  }

  .product-hero .product-name-en {
    font-size: 28px;
  }

  .product-hero .product-tagline {
    font-size: 17px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .pricing-cards-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }

  .nav .container {
    padding: 0 16px;
  }

  .nav-logo {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }
}
