/* ============================================================
   企业系统导航台 — 样式表
   专业企业门户风格，合规页脚
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* 品牌色系 */
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-100: #dbeafe;
  --brand-50:  #eff6ff;

  /* 中性色系 */
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* 功能色 */
  --success: #059669;

  /* 阴影 */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* 圆角 */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* 布局 */
  --content-max: 1200px;
  --topbar-height: 56px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei UI", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   TOPBAR — 顶部导航栏
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.topbar__inner {
  max-width: var(--content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--brand-600);
}

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

.topbar__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__meta-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 400;
}

.topbar__meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  font-family: var(--font-mono);
}

.topbar__meta-divider {
  width: 1px;
  height: 16px;
  background: var(--gray-200);
}

/* ============================================================
   HERO — 主视觉区
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1d4ed8 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* 装饰性背景纹理 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 75% 30%, rgba(255,255,255,0.08), transparent),
    radial-gradient(ellipse 400px 300px at 20% 80%, rgba(255,255,255,0.04), transparent);
  pointer-events: none;
}

/* 网格点装饰 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.hero__title {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero__subtitle {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.72);
  max-width: 480px;
}

/* 搜索框 */
.hero__search {
  width: 360px;
  flex-shrink: 0;
}

.search__control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.search__control:focus-within {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.search__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.6);
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 14px;
  outline: none;
}

.search__input::placeholder {
  color: rgba(255,255,255,0.5);
}

/* 清除 webkit search 输入框自带的装饰 */
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: background 160ms ease;
}

.search__clear:hover {
  background: rgba(255,255,255,0.3);
}

.search__clear svg {
  width: 12px;
  height: 12px;
}

/* 搜索结果摘要 */
.hero__result-summary {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: -8px auto 0;
  padding: 0 24px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* ============================================================
   MAIN CONTENT — 系统卡片区
   ============================================================ */
.main-content {
  flex: 1;
}

.main-content__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* ---------- Status Panel ---------- */
.status-panel {
  display: none;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
}

.status-panel.is-visible {
  display: block;
}

.status-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.status-panel__text {
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.7;
}

.status-panel__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand-600);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease;
}

.status-panel__action:hover {
  background: var(--brand-500);
}

/* ---------- Systems Grid ---------- */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ---------- Card Link ---------- */
.system-card-link,
.system-card-link--disabled {
  display: block;
  min-width: 0;
  border-radius: var(--radius-lg);
  outline-offset: 2px;
}

.system-card-link:focus-visible {
  outline: 2px solid var(--brand-500);
}

/* ---------- System Card ---------- */
.system-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: transform 220ms cubic-bezier(0.22,1,0.36,1),
              box-shadow 220ms cubic-bezier(0.22,1,0.36,1),
              border-color 220ms ease;
}

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

.system-card-link--disabled .system-card {
  opacity: 0.55;
  cursor: not-allowed;
}

.system-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.system-card__icon-box {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.system-card__icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.system-card__fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
  background: var(--brand-50);
}

.system-card__fallback.is-visible {
  display: grid;
}

.system-card__title-group {
  flex: 1;
  min-width: 0;
}

.system-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-card__category {
  margin-top: 2px;
  font-size: 12px;
  color: var(--gray-400);
}

.system-card__desc {
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.system-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.system-card__tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.5;
}

.system-card__action-bar {
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}

.system-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-600);
  transition: gap 200ms ease;
}

.system-card-link:hover .system-card__action {
  gap: 8px;
}

.system-card__arrow {
  width: 14px;
  height: 14px;
}

/* ---------- Loading Skeleton ---------- */
.system-card--loading {
  pointer-events: none;
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03), transparent);
  animation: shimmer 1.6s infinite;
}

.skeleton-icon,
.skeleton-line,
.skeleton-tag {
  border-radius: var(--radius-sm);
  background: var(--gray-100);
}

.skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
}

.skeleton-head {
  display: grid;
  gap: 8px;
  flex: 1;
}

.skeleton-line { height: 12px; }
.skeleton-line--lg { width: 70%; height: 16px; }
.skeleton-line--md { width: 48%; }
.skeleton-line--full { width: 100%; }
.skeleton-line--short { width: 75%; }
.skeleton-tag { width: 56px; height: 22px; border-radius: 999px; }

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ============================================================
   FOOTER — 版权与备案信息
   ============================================================ */
.site-footer {
  background: var(--gray-800);
  color: var(--gray-400);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 4px;
}

.site-footer__links:empty {
  display: none;
}

.site-footer__link {
  color: var(--gray-400);
  font-size: 13px;
  transition: color 160ms ease;
}

.site-footer__link:hover {
  color: var(--gray-200);
}

.site-footer__copyright {
  color: var(--gray-500);
  font-size: 12px;
}

.site-footer__copyright:empty {
  display: none;
}

.site-footer__records {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.site-footer__record {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gray-400);
  font-size: 12px;
  transition: color 160ms ease;
}

.site-footer__record:hover {
  color: var(--gray-200);
}

.site-footer__record-sep {
  color: var(--gray-600);
  font-size: 11px;
  user-select: none;
}

.site-footer__police-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE — 响应式适配
   ============================================================ */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero__search {
    width: 100%;
  }

  .topbar__meta-item--date {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar__inner { padding: 0 16px; }

  .topbar__meta-divider,
  .topbar__meta-label {
    display: none;
  }

  .topbar__meta { gap: 12px; }

  .hero__inner { padding: 32px 16px 28px; }
  .hero__title { font-size: 22px; }

  .main-content__inner { padding: 20px 16px 36px; }

  .systems-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .site-footer__inner { padding: 24px 16px; }
}

/* ---------- 无动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
