/* ============================================
   星澜屿科技 - Design System
   A modern, professional software tech company style
   ============================================ */

/* ----- Design Tokens ----- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-deeper: #1e40af;
  --primary-light: #60a5fa;
  --primary-lighter: #93c5fd;
  --primary-subtle: #dbeafe;

  --accent: #06b6d4;
  --accent-light: #22d3ee;

  --gradient-1: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-2: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --gradient-3: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1e40af 100%);

  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Menlo, Courier, monospace;

  --nav-height: 64px;
  --max-width: 1200px;
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--dark-2);
  line-height: 1.7;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ----- Container ----- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Section ----- */
.section {
  padding: 80px 0;
}
.section-dark {
  background: var(--dark);
  color: #fff;
}
.section-gray {
  background: var(--gray-100);
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}
.section-dark .section-title h2 {
  color: #fff;
}
.section-title p {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}
.section-title .title-bar {
  width: 60px;
  height: 4px;
  background: var(--gradient-1);
  border-radius: 2px;
  margin: 16px auto;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
  transition: var(--transition);
}
.nav.scrolled {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.nav-logo:hover {
  color: var(--primary-light);
}
.nav-logo img {
  height: 32px;
  width: auto;
}
.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-1);
  transition: var(--transition);
}
.nav-links a:hover {
  color: #fff;
}
.nav-links a:hover::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(37, 99, 235, 0.1) 1px, transparent 1px),
              linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-full);
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}
.hero h1 {
  font-size: 52px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--gray-400);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
  flex-wrap: wrap;
}
.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.hero-stat .num span {
  color: var(--primary-light);
}
.hero-stat .label {
  font-size: 14px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-1);
  color: #fff;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.btn-outline:hover {
  border-color: var(--primary-light);
  color: #fff;
  background: rgba(37, 99, 235, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Service / Tool Cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-1);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-lighter);
}
.tool-card:hover::before {
  transform: scaleX(1);
}
.tool-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--primary);
}
.tool-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}
.tool-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}
.tool-card .arrow {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition);
}
.tool-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   TOOL PAGE LAYOUT
   ============================================ */
.tool-page {
  padding-top: calc(var(--nav-height) + 30px);
  padding-bottom: 60px;
  min-height: 100vh;
}
.tool-page .tool-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}
.tool-page .tool-header {
  text-align: center;
  margin-bottom: 36px;
}
.tool-page .tool-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.tool-page .tool-header p {
  font-size: 15px;
  color: var(--gray-500);
}
.tool-page .tool-header .tool-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  margin: 0 auto 16px;
}

.tool-card-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.tool-card-box textarea,
.tool-card-box input[type="text"],
.tool-card-box input[type="number"],
.tool-card-box input[type="date"],
.tool-card-box input[type="password"],
.tool-card-box select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-mono);
  transition: var(--transition);
  background: var(--gray-50);
  color: var(--dark);
  outline: none;
}
.tool-card-box textarea:focus,
.tool-card-box input:focus,
.tool-card-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}
.tool-card-box textarea {
  min-height: 160px;
  resize: vertical;
}
.tool-card-box select {
  font-family: var(--font-sans);
}
.tool-card-box .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
  display: block;
}
.tool-card-box .row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.tool-card-box .col {
  flex: 1;
  min-width: 200px;
}
.tool-card-box .btn-group {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.tool-card-box .btn-group .btn {
  flex: 1;
  min-width: 100px;
}

/* Tool page nav bar */
.tool-topbar {
  background: var(--dark);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
.tool-topbar .back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
}
.tool-topbar .back-link:hover {
  color: #fff;
}
.tool-topbar .brand {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-text h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}
.about-text p {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.8;
}
.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.about-feature {
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.about-feature h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}
.about-feature p {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.contact-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.contact-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.contact-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.contact-card p {
  font-size: 14px;
  color: var(--gray-500);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--dark);
  color: var(--gray-400);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-500);
}
.footer-col h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  color: var(--gray-400);
  font-size: 14px;
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--gray-500);
}
.footer-bottom a {
  color: var(--gray-400);
}
.footer-bottom a:hover {
  color: var(--primary-light);
}

/* ============================================
   SHARE BUTTONS
   ============================================ */
.share-box {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.share-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #1a1a1a;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* ============================================
   SEO DESCRIPTION
   ============================================ */
.seo-desc {
  margin-top: 24px;
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.8;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

/* ============================================
   UTILITY
   ============================================ */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}
.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }
.stagger > *:nth-child(7) { animation-delay: 0.7s; }
.stagger > *:nth-child(8) { animation-delay: 0.8s; }
.stagger > *:nth-child(9) { animation-delay: 0.9s; }
.stagger > *:nth-child(10) { animation-delay: 1.0s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 16px;
  }
  .hero-stats {
    gap: 24px;
  }
  .hero-stat .num {
    font-size: 28px;
  }

  .section {
    padding: 48px 0;
  }
  .section-title h2 {
    font-size: 24px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-features {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }

  .tool-page .tool-header h1 {
    font-size: 22px;
  }
  .tool-card-box {
    padding: 20px;
  }

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 26px;
  }
  .hero-buttons .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   TOOL-SPECIFIC OVERRIDES (applied per page)
   ============================================ */
.tool-result {
  background: var(--gray-50);
  padding: 16px;
  border-radius: var(--radius-sm);
  min-height: 48px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--gray-200);
}
