/* ============================================================ */
/* pages/css/app.css — ConnexionTrack 统一设计系统               */
/* 风格定位：严谨 · 放心 · 周全                                  */
/* ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Primary: 沉稳 Teal — 传递可靠与专业 */
  --ct-teal-50:  #ecfeff;
  --ct-teal-100: #cffafe;
  --ct-teal-200: #a5f3fc;
  --ct-teal-300: #67e8f9;
  --ct-teal-400: #22d3ee;
  --ct-teal-500: #06b6d4;
  --ct-teal-600: #0891b2;
  --ct-teal-700: #0e7490;
  --ct-teal-800: #155e75;
  --ct-teal-900: #164e63;
  --ct-teal-950: #083344;

  /* Accent: 暖金 — 行动号召与高亮 */
  --ct-gold-400: #facc15;
  --ct-gold-500: #eab308;
  --ct-gold-600: #ca8a04;

  /* Neutral: 石材灰阶 — 正文与背景 */
  --ct-gray-50:  #fafaf9;
  --ct-gray-100: #f5f5f4;
  --ct-gray-200: #e7e5e4;
  --ct-gray-300: #d6d3d1;
  --ct-gray-400: #a8a29e;
  --ct-gray-500: #78716c;
  --ct-gray-600: #57534e;
  --ct-gray-700: #44403c;
  --ct-gray-800: #292524;
  --ct-gray-900: #1c1917;

  /* Semantic */
  --ct-success: #059669;
  --ct-success-bg: #ecfdf5;
  --ct-warning: #d97706;
  --ct-warning-bg: #fffbeb;
  --ct-danger:  #dc2626;
  --ct-danger-bg: #fef2f2;

  /* Spacing scale */
  --ct-space-xs: 4px;
  --ct-space-sm: 8px;
  --ct-space-md: 16px;
  --ct-space-lg: 24px;
  --ct-space-xl: 32px;
  --ct-space-2xl: 48px;

  /* Typography */
  --ct-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif;
  --ct-font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --ct-text-xs:  0.75rem;
  --ct-text-sm:  0.875rem;
  --ct-text-base: 1rem;
  --ct-text-lg:  1.125rem;
  --ct-text-xl:  1.25rem;
  --ct-text-2xl: 1.5rem;
  --ct-text-3xl: 1.875rem;

  /* Borders & Shadows */
  --ct-radius-sm: 6px;
  --ct-radius:    10px;
  --ct-radius-lg: 14px;
  --ct-shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --ct-shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --ct-shadow-lg: 0 4px 24px rgba(0,0,0,.08);
  --ct-border: 1px solid var(--ct-gray-200);

  /* Transitions */
  --ct-transition: 160ms ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ct-font);
  font-size: var(--ct-text-base);
  line-height: 1.6;
  color: var(--ct-gray-800);
  background: var(--ct-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: var(--ct-teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Language Bar ──────────────────────────────────────────── */
.ct-lang-bar {
  background: var(--ct-teal-950);
  color: #fff;
  font-size: var(--ct-text-xs);
  padding: 5px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ct-lang-bar button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ct-teal-300);
  cursor: pointer;
  font-size: var(--ct-text-xs);
  padding: 3px 12px;
  border-radius: var(--ct-radius-sm);
  transition: all var(--ct-transition);
  font-family: var(--ct-font);
}
.ct-lang-bar button:hover { color: #fff; border-color: var(--ct-teal-500); }
.ct-lang-bar button.active { color: #fff; border-color: var(--ct-teal-500); background: rgba(255,255,255,.1); }

/* ── Navigation ────────────────────────────────────────────── */
.ct-nav {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--ct-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.ct-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px var(--ct-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ct-nav-logo {
  font-size: var(--ct-text-lg);
  font-weight: 700;
  color: var(--ct-teal-700);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-nav-logo .ct-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ct-gold-500);
}
.ct-nav-links { display: flex; gap: var(--ct-space-lg); list-style: none; }
.ct-nav-links a { color: var(--ct-gray-600); font-weight: 500; font-size: var(--ct-text-sm); }
.ct-nav-links a:hover { color: var(--ct-teal-700); text-decoration: none; }

/* ── Buttons ───────────────────────────────────────────────── */
.ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--ct-radius);
  font-family: var(--ct-font);
  font-size: var(--ct-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ct-transition);
  white-space: nowrap;
}
.ct-btn:active { transform: scale(.97); }
.ct-btn-primary { background: var(--ct-teal-700); color: #fff; box-shadow: var(--ct-shadow-sm); }
.ct-btn-primary:hover { background: var(--ct-teal-800); box-shadow: var(--ct-shadow); }
.ct-btn-gold { background: var(--ct-gold-500); color: var(--ct-gray-900); box-shadow: var(--ct-shadow-sm); }
.ct-btn-gold:hover { background: var(--ct-gold-400); box-shadow: var(--ct-shadow); }
.ct-btn-outline { background: transparent; color: var(--ct-teal-700); border: 1.5px solid var(--ct-teal-300); }
.ct-btn-outline:hover { background: var(--ct-teal-50); border-color: var(--ct-teal-500); }
.ct-btn-sm { padding: 6px 14px; font-size: var(--ct-text-xs); border-radius: var(--ct-radius-sm); }
.ct-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Cards ─────────────────────────────────────────────────── */
.ct-card {
  background: #fff;
  border: var(--ct-border);
  border-radius: var(--ct-radius-lg);
  padding: var(--ct-space-lg);
  box-shadow: var(--ct-shadow-sm);
  margin-bottom: var(--ct-space-md);
}
.ct-card-header {
  font-size: var(--ct-text-base);
  font-weight: 700;
  color: var(--ct-gray-900);
  margin-bottom: var(--ct-space-md);
  display: flex;
  align-items: center;
  gap: var(--ct-space-sm);
}

/* ── Form Elements ─────────────────────────────────────────── */
.ct-input, .ct-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--ct-gray-200);
  border-radius: var(--ct-radius);
  font-family: var(--ct-font);
  font-size: var(--ct-text-sm);
  color: var(--ct-gray-800);
  background: #fff;
  outline: none;
  transition: border var(--ct-transition), box-shadow var(--ct-transition);
}
.ct-input:focus, .ct-select:focus {
  border-color: var(--ct-teal-500);
  box-shadow: 0 0 0 3px rgba(6,182,212,.12);
}
.ct-input::placeholder { color: var(--ct-gray-400); }
.ct-label {
  display: block;
  font-size: var(--ct-text-xs);
  font-weight: 600;
  color: var(--ct-gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: var(--ct-space-xs);
}
.ct-field { display: flex; flex-direction: column; gap: var(--ct-space-xs); }

/* ── Form Group ────────────────────────────────────────────── */
.ct-form-group { margin-bottom: var(--ct-space-md); text-align: left; }

/* ── Tables ────────────────────────────────────────────────── */
.ct-table { width: 100%; border-collapse: collapse; font-size: var(--ct-text-sm); }
.ct-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--ct-gray-400);
  font-weight: 600;
  font-size: var(--ct-text-xs);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 2px solid var(--ct-gray-100);
}
.ct-table td { padding: 12px; border-bottom: 1px solid var(--ct-gray-100); vertical-align: middle; }
.ct-table tr:hover { background: var(--ct-teal-50); }
.ct-table .ct-mono { font-family: var(--ct-font-mono); font-size: var(--ct-text-xs); letter-spacing: .5px; }

/* ── Badges ────────────────────────────────────────────────── */
.ct-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: var(--ct-text-xs);
  font-weight: 600;
}
.ct-badge-success { background: var(--ct-success-bg); color: var(--ct-success); }
.ct-badge-info    { background: var(--ct-teal-50);   color: var(--ct-teal-700); }
.ct-badge-warning { background: var(--ct-warning-bg); color: var(--ct-warning); }

/* ── Status Timeline ──────────────────────────────────────── */
.ct-timeline { position: relative; padding-left: 36px; }
.ct-timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--ct-gray-200);
}
.ct-timeline-step { position: relative; padding: 12px 0; }
.ct-timeline-step:last-child { padding-bottom: 0; }
.ct-timeline-dot {
  position: absolute;
  left: -26px;
  top: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  z-index: 2;
  border: 2px solid #fff;
  background: var(--ct-gray-200);
  color: var(--ct-gray-400);
  box-shadow: var(--ct-shadow-sm);
}
.ct-timeline-step.ct-done .ct-timeline-dot { background: var(--ct-teal-600); color: #fff; }
.ct-timeline-step.ct-current .ct-timeline-dot {
  background: var(--ct-gold-500);
  color: var(--ct-gray-900);
  animation: ct-pulse 2s infinite;
  box-shadow: 0 0 0 5px rgba(234,179,8,.2);
}
@keyframes ct-pulse { 0%,100% { box-shadow: 0 0 0 5px rgba(234,179,8,.2); } 50% { box-shadow: 0 0 0 12px rgba(234,179,8,.08); } }
.ct-timeline-label { font-weight: 600; font-size: var(--ct-text-sm); color: var(--ct-gray-400); }
.ct-timeline-step.ct-done .ct-timeline-label { color: var(--ct-gray-600); }
.ct-timeline-step.ct-current .ct-timeline-label { color: var(--ct-gray-900); }
.ct-timeline-time { font-size: var(--ct-text-xs); color: var(--ct-gray-400); margin-top: 2px; }

/* ── Page Sections ─────────────────────────────────────────── */
.ct-section { padding: var(--ct-space-2xl) 0; }
.ct-section-alt { background: #fff; }
.ct-container { max-width: 1120px; margin: 0 auto; padding: 0 var(--ct-space-lg); }
.ct-container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.ct-section-title {
  text-align: center;
  font-size: var(--ct-text-3xl);
  font-weight: 800;
  color: var(--ct-gray-900);
  margin-bottom: var(--ct-space-sm);
  letter-spacing: -.5px;
}
.ct-section-sub {
  text-align: center;
  color: var(--ct-gray-500);
  font-size: var(--ct-text-lg);
  max-width: 600px;
  margin: 0 auto var(--ct-space-2xl);
  line-height: 1.7;
}

/* ── Hero ──────────────────────────────────────────────────── */
.ct-hero {
  background: linear-gradient(165deg, var(--ct-teal-900) 0%, var(--ct-teal-800) 40%, var(--ct-teal-700) 100%);
  color: #fff;
  padding: var(--ct-space-2xl) 0 calc(var(--ct-space-2xl) + 16px);
  position: relative;
  overflow: hidden;
}
.ct-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -40px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
}
.ct-hero-inner { max-width: 800px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.ct-hero h1 { font-size: var(--ct-text-3xl); font-weight: 800; line-height: 1.2; margin-bottom: var(--ct-space-md); letter-spacing: -.5px; }
.ct-hero h1 .ct-highlight { color: var(--ct-gold-400); }
.ct-hero p { font-size: var(--ct-text-lg); opacity: .9; max-width: 560px; margin: 0 auto var(--ct-space-xl); line-height: 1.7; }

/* ── Features Grid ─────────────────────────────────────────── */
.ct-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--ct-space-lg); }
.ct-feature-card {
  background: #fff;
  border: var(--ct-border);
  border-radius: var(--ct-radius-lg);
  padding: var(--ct-space-xl) var(--ct-space-lg);
  box-shadow: var(--ct-shadow-sm);
  transition: box-shadow var(--ct-transition);
}
.ct-feature-card:hover { box-shadow: var(--ct-shadow-lg); }
.ct-feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--ct-radius);
  background: var(--ct-teal-50);
  color: var(--ct-teal-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: var(--ct-space-md);
}
.ct-feature-card h3 { font-size: var(--ct-text-base); font-weight: 700; color: var(--ct-gray-900); margin-bottom: var(--ct-space-xs); }
.ct-feature-card p { font-size: var(--ct-text-sm); color: var(--ct-gray-600); line-height: 1.7; }

/* ── Steps ─────────────────────────────────────────────────── */
.ct-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--ct-space-xl); }
.ct-step { text-align: center; }
.ct-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ct-teal-700);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: var(--ct-space-md);
  box-shadow: var(--ct-shadow);
}
.ct-step h3 { font-size: var(--ct-text-base); font-weight: 700; color: var(--ct-gray-900); margin-bottom: var(--ct-space-xs); }
.ct-step p { font-size: var(--ct-text-sm); color: var(--ct-gray-600); line-height: 1.7; }

/* ── CTA Section ───────────────────────────────────────────── */
.ct-cta {
  background: linear-gradient(165deg, var(--ct-teal-900), var(--ct-teal-800));
  color: #fff;
  text-align: center;
}
.ct-cta h2 { color: #fff; font-size: var(--ct-text-2xl); }
.ct-cta p { color: rgba(255,255,255,.85); margin: var(--ct-space-sm) 0 var(--ct-space-lg); }

/* ── Footer ────────────────────────────────────────────────── */
.ct-footer {
  background: var(--ct-gray-900);
  color: var(--ct-gray-300);
  text-align: center;
  padding: var(--ct-space-xl) var(--ct-space-lg);
  font-size: var(--ct-text-sm);
}
.ct-footer a { color: var(--ct-teal-300); }

/* ── Top Bar (Admin) ───────────────────────────────────────── */
.ct-topbar {
  background: var(--ct-teal-950);
  color: #fff;
  padding: 10px var(--ct-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ct-space-sm);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ct-topbar .ct-user-info { font-size: var(--ct-text-sm); }
.ct-topbar .ct-user-info strong { color: var(--ct-gold-400); }
.ct-topbar button {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--ct-radius-sm);
  cursor: pointer;
  font-size: var(--ct-text-xs);
  font-family: var(--ct-font);
  transition: all var(--ct-transition);
}
.ct-topbar button:hover { background: rgba(255,255,255,.2); }

/* ── Tabs ──────────────────────────────────────────────────── */
.ct-tabs { display: flex; border-bottom: 2px solid var(--ct-gray-200); margin-bottom: var(--ct-space-lg); }
.ct-tab {
  padding: 10px 24px;
  border: none;
  background: transparent;
  font-size: var(--ct-text-sm);
  font-weight: 600;
  font-family: var(--ct-font);
  cursor: pointer;
  color: var(--ct-gray-400);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--ct-transition);
}
.ct-tab.active { color: var(--ct-teal-700); border-bottom-color: var(--ct-teal-600); }
.ct-tab-content { display: none; }
.ct-tab-content.active { display: block; }

/* ── Messages ──────────────────────────────────────────────── */
.ct-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: var(--ct-radius);
  font-size: var(--ct-text-sm);
  font-weight: 600;
  box-shadow: var(--ct-shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.ct-toast.show { opacity: 1; }
.ct-toast-ok  { background: var(--ct-success); color: #fff; }
.ct-toast-err { background: var(--ct-danger); color: #fff; }

/* ── States ────────────────────────────────────────────────── */
.ct-state { text-align: center; padding: var(--ct-space-2xl) var(--ct-space-lg); }
.ct-state-icon { font-size: 3rem; margin-bottom: var(--ct-space-md); }
.ct-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--ct-gray-200);
  border-top-color: var(--ct-teal-600);
  border-radius: 50%;
  animation: ct-spin .7s linear infinite;
  margin: 0 auto var(--ct-space-md);
}
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* ── Inline Form ───────────────────────────────────────────── */
.ct-form-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: var(--ct-space-md);
}
.ct-form-inline .ct-field { min-width: 120px; }

/* ── Share Bar ─────────────────────────────────────────────── */
.ct-share-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ct-share-bar input { flex: 1; min-width: 200px; }

/* ── Flight Route ──────────────────────────────────────────── */
.ct-flight-route {
  display: flex;
  align-items: center;
  gap: var(--ct-space-lg);
  padding: var(--ct-space-md) 0;
}
.ct-flight-point { text-align: center; }
.ct-flight-point .ct-code { font-size: var(--ct-text-xl); font-weight: 800; color: var(--ct-teal-700); font-family: var(--ct-font-mono); }
.ct-flight-point .ct-city { font-size: var(--ct-text-xs); color: var(--ct-gray-500); margin-top: 2px; }
.ct-flight-line { flex: 1; height: 2px; background: var(--ct-gray-200); position: relative; }
.ct-flight-line::after { content: '✈'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 1.1rem; }

/* ── Card Grid ─────────────────────────────────────────────── */
.ct-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ct-space-md) var(--ct-space-lg); }
.ct-card-field-label { font-size: var(--ct-text-xs); color: var(--ct-gray-400); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.ct-card-field-value { font-size: var(--ct-text-sm); font-weight: 600; color: var(--ct-gray-800); }

/* ── Utility ───────────────────────────────────────────────── */
.ct-text-center { text-align: center; }
.ct-mt-lg { margin-top: var(--ct-space-lg); }
.ct-mb-lg { margin-bottom: var(--ct-space-lg); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ct-hero h1 { font-size: var(--ct-text-2xl); }
  .ct-hero p { font-size: var(--ct-text-base); }
  .ct-section-title { font-size: var(--ct-text-2xl); }
  .ct-card-grid { grid-template-columns: 1fr; }
  .ct-nav-links { display: none; }
  .ct-features { grid-template-columns: 1fr; }
}
