/* ============================================
   HICHIP Corp Website v2.5 — Design System
   Dark Premium Theme | Neo Cloud Aesthetic
   ============================================ */

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-elevated: rgba(30, 41, 59, 0.5);
  --accent: #1c91c3;
  --accent-hover: #1679a3;
  --accent-glow: rgba(28, 145, 195, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.1);
  --border-hover: rgba(148, 163, 184, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(28, 145, 195, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

/* ── Language Switching ── */
.lang-zh, .lang-en { display: none !important; }
html[data-lang="zh"] .lang-zh { display: block !important; }
html[data-lang="en"] .lang-en { display: block !important; }
html[data-lang="zh"] span.lang-zh,
html[data-lang="en"] span.lang-en { display: inline !important; }

/* ── Layout ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Section Title ── */
.section-title {
  text-align: center;
  margin-bottom: 64px;
}

.section-title h2 {
  margin-bottom: 16px;
}

.section-title .subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(28, 145, 195, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(28, 145, 195, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(28, 145, 195, 0.08);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, rgba(28,145,195,0.2), transparent 50%);
  z-index: -1;
  opacity: 0;
  transition: var(--transition);
}

.card-glow:hover::before {
  opacity: 1;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 60%, rgba(10, 14, 26, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.logo:hover {
  opacity: 0.85;
}
.logo img {
  height: 38px;
  display: block;
  filter: brightness(1.1);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-desktop a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text-primary);
}

.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
  border-radius: 1px;
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
  width: 100%;
}

.nav-desktop .has-dropdown {
  position: relative;
}

.nav-desktop .has-dropdown > a::after {
  display: none;
}

.nav-desktop .has-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-desktop .has-dropdown > a svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: var(--transition);
}

.nav-desktop .has-dropdown:hover > a svg {
  opacity: 1;
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 0;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dropdown a:hover {
  color: var(--text-primary);
  background: rgba(28, 145, 195, 0.08);
}

.lang-switcher select {
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5L6 8L9 5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ── Mobile Nav ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  position: relative;
  z-index: 1002;
}

.hamburger:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #f8fafc;
  transition: var(--transition);
  border-radius: 1px;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #0f172a 0%, #0a0e1a 100%);
  z-index: 9999;
  padding: 24px 24px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-overflow-scrolling: touch;
}

.mobile-nav.active { display: block; }

.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.mobile-nav a:first-child {
  padding-top: 8px;
}

.mobile-nav a.active {
  color: var(--accent);
}

.mobile-dropdown {
  padding-left: 16px;
  display: none;
}

.mobile-dropdown.open { display: block; }

.mobile-dropdown a {
  font-size: 0.9rem;
  padding: 10px 0;
  border-bottom: none;
}

.mobile-dropdown-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

.mobile-dropdown-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.mobile-dropdown.open + .mobile-dropdown-arrow,
.mobile-dropdown-toggle[aria-expanded="true"] .mobile-dropdown-arrow {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 80px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand img {
  height: 32px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.footer-brand p {
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.footer-col h5 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 36px 24px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

/* ── Scroll to Top ── */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero Section Base ── */
.page-hero {
  position: relative;
  padding: 160px 0 100px;
  min-height: 50vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0e1a 0%, #111827 50%, #0f172a 100%);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 1.15rem;
  max-width: 640px;
  color: var(--text-secondary);
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* ── Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(28, 145, 195, 0.1);
  border: 1px solid rgba(28, 145, 195, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
}

.feature-card h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ── Glow Divider ── */
.glow-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28,145,195,0.3), transparent);
  margin: 0 auto;
  max-width: 200px;
}

/* ── Section Base ── */
section {
  padding: 100px 0;
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
}

/* ── Table Base ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: rgba(28, 145, 195, 0.04);
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active,
.tab-btn:hover {
  background: rgba(28, 145, 195, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue {
  background: rgba(28, 145, 195, 0.1);
  color: var(--accent);
  border: 1px solid rgba(28, 145, 195, 0.2);
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}
