/* ============================================
   华鼎码 - Huading Code
   Modern Stylesheet (2026)
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #1a237e;
  --primary-light: #283593;
  --primary-dark: #0d1542;
  --accent: #ff6f00;
  --accent-light: #ffa040;
  --accent-glow: rgba(255, 111, 0, 0.15);

  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-alt: #e8eaf6;

  --text: #212121;
  --text-light: #5f6368;
  --text-muted: #9aa0a6;
  --text-on-primary: #ffffff;

  --border: #e0e0e0;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

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

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
}

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

ul, ol {
  padding-left: 1.5rem;
}

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}
.nav-brand img {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-light);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--primary);
  color: var(--text-on-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: all 0.3s;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-on-primary);
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255, 111, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.8;
}
.hero-tagline {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 20px;
}
.hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Page Header (sub-pages) --- */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-on-primary);
  padding: 36px 0;
  text-align: center;
}
.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}
.page-header p {
  opacity: 0.85;
  margin-top: 6px;
  font-size: 0.95rem;
}

/* --- Sections --- */
.section {
  padding: 48px 0;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  text-align: center;
}
.section-subtitle {
  color: var(--text-light);
  text-align: center;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.25s;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Feature List --- */
.feature-list {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.feature-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.feature-item:last-child {
  border-bottom: none;
}
.feature-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Info Box --- */
.info-box {
  background: linear-gradient(135deg, var(--accent-glow), rgba(26, 35, 126, 0.05));
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}
.info-box strong {
  color: var(--primary);
}

/* --- Product Table --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--primary);
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--bg);
}

/* --- Columns --- */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .cols-2 {
    grid-template-columns: 1fr;
  }
}

/* --- Content (article text) --- */
.content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  line-height: 1.9;
}
.content h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}
.content h2:first-child {
  margin-top: 0;
}
.content h3 {
  font-size: 1.1rem;
  color: var(--primary-light);
  margin: 20px 0 8px;
}
.content p {
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.content b, .content strong {
  color: var(--primary);
}

/* --- Quote --- */
blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  line-height: 1.5;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-light);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: #e65100;
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* --- Flash Gallery (hden) --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.25s;
}
.gallery-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.gallery-item a {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Contact Info --- */
.contact-info {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.contact-info p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* --- Code Table --- */
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}
.code-table th,
.code-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}
.code-table th {
  background: var(--primary);
  color: #fff;
}
.code-table tr:nth-child(even) td {
  background: var(--bg);
}

/* --- Download Section --- */
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}
.download-info {
  flex: 1;
  min-width: 200px;
}
.download-info h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 4px;
}

/* --- Footer --- */
.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 32px 0 24px;
  margin-top: 48px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 2;
}
.footer a {
  color: rgba(255, 255, 255, 0.9);
}
.footer a:hover {
  color: var(--accent-light);
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
}
.footer-links a {
  font-size: 0.82rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 20px 16px;
  }
  .hero-meta {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 40px 0 32px;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .section {
    padding: 32px 0;
  }
  .page-header h1 {
    font-size: 1.4rem;
  }
  .footer-links {
    flex-direction: column;
    gap: 6px;
  }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 24px; }
.mt-3 { margin-top: 36px; }
.mb-1 { margin-bottom: 12px; }
.mb-2 { margin-bottom: 24px; }

/* --- Greeting Bar --- */
.greeting-bar {
  background: var(--primary);
  color: var(--text-on-primary);
  font-size: 0.82rem;
  padding: 6px 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.greeting-bar a {
  color: var(--accent-light);
}

/* --- Highlight box --- */
.highlight-box {
  background: linear-gradient(135deg, #fff3e0, #fff8e1);
  border: 1px solid #ffe0b2;
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}

/* --- Image showcase --- */
.img-showcase {
  text-align: center;
  margin: 20px 0;
}
.img-showcase img {
  display: inline-block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Patent badge --- */
.patent-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.6;
}
.patent-badge strong {
  color: var(--accent);
  font-size: 1rem;
}
.patent-badge .patent-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
}
