/* ==========================================================================
   lzzlzz 的内测工具集 — 浅色开发者门户主题
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;

  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-soft: #fafbfe;
  --border: #e2e8f2;
  --border-strong: #cdd7e6;

  --text: #16203a;
  --text-soft: #44526b;
  --muted: #77849b;

  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --teal: #0d9488;
  --teal-soft: #e6f7f5;
  --danger: #dc2626;
  --warn: #c2410c;
  --warn-soft: #fff7ed;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(20, 40, 80, 0.05);
  --shadow-md: 0 14px 34px -22px rgba(25, 45, 90, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --wrap: 1120px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(79, 70, 229, 0.18);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-strong);
}

a {
  color: inherit;
}

/* 背景装饰 ---------------------------------------------------------------- */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(900px 420px at 50% -180px, #e4e9ff 0%, rgba(228, 233, 255, 0) 72%),
    radial-gradient(700px 360px at 100% 0%, #e9fbf7 0%, rgba(233, 251, 247, 0) 70%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(30, 60, 120, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 60, 120, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 58%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 58%);
}

/* 布局 ------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

/* 顶栏 ------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(226, 232, 242, 0.9);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 48%, #0d9488 100%);
  box-shadow: 0 6px 14px -8px rgba(67, 56, 202, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid #d9dcfb;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.beta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

/* Hero ------------------------------------------------------------------- */

.hero {
  padding: 58px 0 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow code {
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 750;
  background: linear-gradient(115deg, #131c33 0%, #27306b 52%, #3b3f9c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 650px;
  margin: 15px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-soft);
}

/* 工具栏 ----------------------------------------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
  max-width: 540px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  appearance: none;
}

#search::placeholder {
  color: #9aa5b8;
}

#search:hover {
  border-color: var(--border-strong);
}

#search:focus {
  border-color: #a5aaf0;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

#search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: center / 14px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 3l8 8M11 3l-8 8' stroke='%2377849b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  cursor: pointer;
}

.search-box kbd {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  min-width: 20px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease,
    transform 0.1s ease, box-shadow 0.16s ease;
}

.btn:hover {
  border-color: var(--border-strong);
  background: #fbfcff;
  box-shadow: 0 4px 12px -8px rgba(25, 45, 90, 0.35);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.refresh-icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.btn.is-spinning .refresh-icon {
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 状态行 ----------------------------------------------------------------- */

.status {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

/* 卡片网格 --------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #0d9488);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: #c3c8f4;
  box-shadow: var(--shadow-md);
}

a.card:hover::before {
  transform: scaleX(1);
}

a.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mono {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.mono-0 {
  background: #eef0ff;
  color: #4f46e5;
}

.mono-1 {
  background: var(--teal-soft);
  color: #0f766e;
}

.mono-2 {
  background: #fff4e5;
  color: #b45309;
}

.mono-3 {
  background: #fdeef2;
  color: #be123c;
}

.mono-4 {
  background: #e8f1ff;
  color: #1d4ed8;
}

.mono-5 {
  background: #f3ecff;
  color: #7c3aed;
}

.badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #d7f2e8;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-readme {
  border-color: var(--border);
  background: #f4f6fb;
  color: #64748b;
}

.badge-warn {
  border-color: #fed7aa;
  background: var(--warn-soft);
  color: var(--warn);
}

.card-title {
  margin: 0;
  font-size: 17.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--text-soft);
}

.card-desc.is-muted {
  color: #98a4b8;
  font-style: italic;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}

.card-path {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
}

.card-open::after {
  content: "↗";
  font-size: 13px;
  transition: transform 0.18s ease;
}

a.card:hover .card-open::after {
  transform: translate(2px, -2px);
}

.card.is-disabled {
  border-style: dashed;
  background: var(--surface-soft);
  box-shadow: none;
  cursor: not-allowed;
}

.card.is-disabled .card-title {
  color: #5b6880;
}

.card.is-disabled .card-desc {
  color: #98a4b8;
}

.card.is-disabled .card-open {
  color: #9aa5b8;
  font-weight: 600;
}

.card.is-disabled .card-open::after {
  content: "";
}

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: rgba(79, 70, 229, 0.15);
  color: var(--accent-strong);
  font-weight: 600;
}

/* 骨架屏 ----------------------------------------------------------------- */

.card.skeleton {
  cursor: default;
  pointer-events: none;
}

.card.skeleton::before {
  display: none;
}

.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    #eef2f8 25%,
    #f8fafe 37%,
    #eef2f8 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.sk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sk-mono {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.sk-pill {
  width: 58px;
  height: 20px;
  border-radius: 999px;
}

.sk-title {
  width: 62%;
  height: 18px;
}

.sk-line {
  width: 100%;
  height: 11px;
}

.sk-line.short {
  width: 72%;
}

.sk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
}

.sk-path {
  width: 46%;
  height: 11px;
}

.sk-open {
  width: 48px;
  height: 11px;
}

/* 空状态 ----------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 54px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-icon {
  width: 44px;
  height: 44px;
  color: #a9b4c7;
}

.empty h2 {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 650;
}

.empty p {
  max-width: 420px;
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.empty .btn {
  height: 38px;
  margin-top: 18px;
  padding: 0 15px;
  font-size: 13px;
}

/* 页脚 ------------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.footer-sep {
  color: #c3cbda;
}

.site-footer code {
  font-size: 11px;
  background: rgba(79, 70, 229, 0.06);
}

/* 响应式 ----------------------------------------------------------------- */

@media (max-width: 860px) {
  .wrap {
    padding: 0 20px;
  }

  .hero {
    padding: 42px 0 26px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    max-width: none;
  }

  .toolbar-right {
    justify-content: space-between;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

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

  .header-inner {
    height: 58px;
  }

  .hero {
    padding: 34px 0 22px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .lede {
    font-size: 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

  .site-footer {
    margin-top: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
