/* ============================================
   麦晟云科技 - UI组件样式
   components.css: 可复用UI组件
   ============================================ */

/* ----- Navbar ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background var(--transition-base), box-shadow var(--transition-base), backdrop-filter var(--transition-base);
}

.navbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-small);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-links a.active {
  color: var(--text-brand);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
}

/* Scrolled state */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-nav);
}

.navbar.scrolled .nav-links a {
  color: var(--text-secondary);
}

/* Hero navbar - dark text on light bg */
.navbar--hero a:not(.btn) {
  color: var(--text-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 1023px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--header-height) + var(--space-8)) var(--space-8) var(--space-8);
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    gap: var(--space-1);
    transition: right var(--transition-base);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body);
    border-radius: var(--radius-md);
  }

  .nav-links a.active::after {
    left: 0;
    transform: none;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
  }

  /* Overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--brand);
  color: var(--text-inverse);
  border-color: var(--brand);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 131, 223, 0.25);
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline:hover {
  background: var(--brand);
  color: var(--text-inverse);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--brand);
  background: var(--brand-50);
}

.btn-inverse {
  background: var(--text-inverse);
  color: var(--text-primary);
  border-color: var(--text-inverse);
}

.btn-inverse:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-small);
}

.btn {
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-body);
}

.btn-lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-body-lg);
}

/* ----- Cards ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

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

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--brand-50);
  color: var(--brand);
  margin-bottom: var(--space-5);
  flex-shrink: 0;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--space-3);
  font-weight: var(--fw-semibold);
}

.card p {
  font-size: var(--text-small);
  line-height: var(--lh-relaxed);
}

/* Data Card */
.data-card {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.data-card .data-number {
  font-size: var(--text-data);
  font-weight: var(--fw-bold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-2);
}

.data-card .data-label {
  font-size: var(--text-small);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

/* Pricing Card */
.pricing-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: var(--space-10) var(--space-8);
  position: relative;
  border: 2px solid var(--border);
}

.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-brand);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
}

.pricing-card .plan-name {
  font-size: var(--text-h3);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-2);
}

.pricing-card .plan-desc {
  font-size: var(--text-small);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.pricing-card .plan-price {
  font-size: var(--text-data-sm);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.pricing-card .plan-price span {
  font-size: var(--text-body);
  font-weight: var(--fw-normal);
  color: var(--text-muted);
}

.pricing-card .plan-features {
  text-align: left;
  margin: var(--space-8) 0;
  flex-grow: 1;
}

.pricing-card .plan-features li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.pricing-card .plan-features li .check {
  color: var(--success);
  flex-shrink: 0;
}

.pricing-card .plan-features li .check svg {
  width: 18px;
  height: 18px;
}

/* Case Card */
.case-card {
  overflow: hidden;
}

.case-card .case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.case-card .case-name {
  font-size: var(--text-h4);
  font-weight: var(--fw-semibold);
}

.case-card .case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-light);
}

.case-card .metric {
  text-align: center;
}

.case-card .metric-value {
  font-size: var(--text-h3);
  font-weight: var(--fw-bold);
  color: var(--brand);
}

.case-card .metric-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ----- Tags ----- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag-brand {
  background: var(--brand-50);
  color: var(--brand);
  border-color: var(--brand-200);
}

.tag-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Filter tags */
.tag-filter {
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
}

.tag-filter:hover {
  border-color: var(--brand-200);
  color: var(--brand);
}

.tag-filter.active {
  background: var(--brand);
  color: var(--text-inverse);
  border-color: var(--brand);
}

/* ----- Timeline ----- */
.timeline {
  position: relative;
  padding-left: var(--space-10);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand), var(--brand-300));
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-10);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) + 4px);
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--brand-50);
}

.timeline-year {
  display: inline-block;
  font-size: var(--text-small);
  font-weight: var(--fw-bold);
  color: var(--brand);
  background: var(--brand-50);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.timeline-title {
  font-size: var(--text-h4);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.timeline-desc {
  font-size: var(--text-small);
  color: var(--text-muted);
}

/* ----- Process Steps ----- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  position: relative;
}

.process-step {
  text-align: center;
  position: relative;
}

.process-step-number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  font-weight: var(--fw-bold);
  font-size: var(--text-body-lg);
  position: relative;
  z-index: 1;
}

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  left: calc(50% + 24px);
  width: calc(100% - 48px);
  height: 2px;
  background: var(--border);
}

.process-step-title {
  font-size: var(--text-small);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.process-step-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .process-step:not(:last-child)::after {
    display: none;
  }
}

/* ----- Forms ----- */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  font-size: var(--text-small);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ----- Stats Bar ----- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  padding: var(--space-12) 0;
}

@media (max-width: 767px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

/* ----- Grid Utilities ----- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Footer ----- */
.site-footer {
  background: var(--bg-secondary);
  padding-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-12);
}

.footer-brand img {
  height: 40px;
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--text-small);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.footer-col h4 {
  font-size: var(--text-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul li {
  margin-bottom: var(--space-3);
}

.footer-col ul li a {
  font-size: var(--text-small);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
  color: var(--brand);
}

.footer-col .contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-small);
  color: var(--text-muted);
}

.footer-col .contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
}

/* ----- Highlight Box ----- */
.highlight-box {
  background: var(--info-bg);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
}

.highlight-box p {
  color: var(--text-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--fw-medium);
}

/* ----- Comparison Table ----- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-table thead {
  background: var(--bg-secondary);
}

.compare-table th,
.compare-table td {
  padding: var(--space-4) var(--space-6);
  text-align: left;
  font-size: var(--text-small);
}

.compare-table th {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}

.compare-table td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.compare-table .col-highlight {
  background: var(--brand-50);
}

.compare-table .col-highlight td {
  color: var(--brand-800);
  font-weight: var(--fw-medium);
}

@media (max-width: 767px) {
  .compare-table {
    display: block;
    overflow-x: auto;
  }
}

/* ----- Icon inline ----- */
.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--brand);
  flex-shrink: 0;
}

.icon-inline svg {
  width: 100%;
  height: 100%;
}
