/* ========================================
   EasyReport Website - Global Styles
   ======================================== */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #303133;
  background: #fff;
  line-height: 1.7;
}
a { color: #409EFF; text-decoration: none; transition: color .2s; }
a:hover { color: #66b1ff; }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* Variables via custom properties */
:root {
  --primary: #409EFF;
  --primary-light: #ecf5ff;
  --primary-dark: #337ecc;
  --success: #67C23A;
  --warning: #E6A23C;
  --danger: #F56C6C;
  --info: #909399;
  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --border-color: #e4e7ed;
  --bg-light: #f5f7fa;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,.1);
  --nav-height: 64px;
  --max-width: 1200px;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.navbar .container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar .logo svg { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  color: var(--text-regular);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* ========== Main Content Offset ========== */
.main { padding-top: var(--nav-height); }

/* ========== Hero Section ========== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 60%);
  padding: 80px 24px;
  text-align: center;
}
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero h1 span { color: var(--primary); }
.hero .subtitle {
  font-size: 20px;
  color: var(--text-regular);
  max-width: 600px;
  margin: 0 auto 32px;
}
.hero .cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sub-hero for product pages */
.hero-sub {
  padding: 60px 24px 48px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 80%);
}
.hero-sub h1 { font-size: 36px; margin-bottom: 12px; }
.hero-sub .subtitle { font-size: 18px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .25s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(64,158,255,.35);
}
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}

/* ========== Section ========== */
.section {
  padding: 64px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-light);
}
.section-alt .section {
  padding-top: 64px;
  padding-bottom: 64px;
}
.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 48px;
  font-size: 16px;
}

/* ========== Product Cards (Homepage) ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.product-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all .3s;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.product-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}
.product-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.product-card p {
  color: var(--text-regular);
  margin-bottom: 20px;
  line-height: 1.8;
}
.product-card .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.product-card .tag {
  background: var(--bg-light);
  color: var(--text-regular);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border-color);
}

/* ========== Feature Grid ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.feature-item {
  text-align: center;
  padding: 32px 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  transition: all .3s;
}
.feature-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.feature-item .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.feature-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-item p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== DB Badge Grid ========== */
.db-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 48px;
}
.db-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 28px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  min-width: 130px;
  transition: all .3s;
}
.db-badge:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.db-badge .db-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.db-badge span { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ========== Feature Blocks (Product Pages) ========== */
.feature-blocks { display: flex; flex-direction: column; gap: 48px; }
.feature-block {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.feature-block:nth-child(even) { flex-direction: row-reverse; }
.feature-block .fb-content { flex: 1; }
.feature-block .fb-visual {
  flex: 1;
  background: var(--bg-light);
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--border-color);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.feature-block h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-block h3 .num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.feature-block p {
  color: var(--text-regular);
  margin-bottom: 16px;
}
.feature-block ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feature-block ul li {
  color: var(--text-regular);
  padding-left: 20px;
  position: relative;
}
.feature-block ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* ========== Enhancement List ========== */
.enhance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.enhance-item {
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all .3s;
}
.enhance-item:hover { box-shadow: var(--shadow); }
.enhance-item h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}
.enhance-item p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== Footer ========== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 40px 24px;
  text-align: center;
  font-size: 14px;
}
.footer a { color: var(--primary); }
.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

/* ========== Doc Page Layout ========== */
.doc-layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}
.doc-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background: var(--bg-light);
  padding: 24px 0;
  position: fixed;
  top: var(--nav-height);
  bottom: 0;
  overflow-y: auto;
}
.doc-sidebar .sidebar-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 24px 8px;
}
.doc-sidebar a {
  display: block;
  padding: 8px 24px 8px 36px;
  color: var(--text-regular);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.doc-sidebar a:hover {
  background: #e8eef5;
  color: var(--primary);
}
.doc-sidebar a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}
.doc-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px 48px 64px;
  max-width: 860px;
}

/* Doc content markdown styles */
.doc-content h1 { font-size: 28px; font-weight: 700; margin: 0 0 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border-color); }
.doc-content h2 { font-size: 22px; font-weight: 700; margin: 40px 0 16px; color: var(--text-primary); }
.doc-content h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; }
.doc-content p { margin-bottom: 16px; color: var(--text-regular); }
.doc-content ul, .doc-content ol { padding-left: 24px; margin-bottom: 16px; list-style: disc; }
.doc-content ol { list-style: decimal; }
.doc-content li { margin-bottom: 6px; color: var(--text-regular); }
.doc-content code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--danger);
}
.doc-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 20px;
}
.doc-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.doc-content th, .doc-content td {
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
}
.doc-content th { background: var(--bg-light); font-weight: 600; }
.doc-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 0 0 20px;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.doc-content blockquote p { margin-bottom: 0; color: var(--text-primary); }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: #fff; flex-direction: column; gap: 0; padding: 8px 0; border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow); }
  .nav-links.show { display: flex; }
  .nav-links a { padding: 12px 24px; }
  .nav-toggle { display: block; }

  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 16px; }
  .hero { padding: 48px 16px; }
  .hero-sub h1 { font-size: 26px; }

  .product-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .enhance-grid { grid-template-columns: 1fr; }

  .feature-block,
  .feature-block:nth-child(even) { flex-direction: column; }
  .feature-block .fb-visual { min-height: 120px; }

  .doc-sidebar { display: none; position: fixed; z-index: 99; }
  .doc-sidebar.show { display: block; width: 80%; max-width: 300px; }
  .doc-content { margin-left: 0; padding: 24px 16px; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .db-grid { gap: 12px; }
  .db-badge { min-width: 100px; padding: 14px 16px; }
}
