/* =========================================
   KeyNav - 快捷键导航 · 深色高级版
   Arc / Linear / Raycast 风格
   设计语言：深色基底 + 霓虹光晕 + 毛玻璃 + 品牌色发光
   ========================================= */

:root {
  /* 主色调 —— 紫蓝霓虹 */
  --accent:        #7c5cff;
  --accent-soft:   #a78bfa;
  --accent-glow:   rgba(124, 92, 255, 0.5);

  /* 背景分层 */
  --bg-base:       #0a0a12;
  --bg-deep:       #06060c;
  --bg-card:       rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.045);
  --bg-glass:      rgba(20, 20, 35, 0.65);

  /* 边框 */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(124, 92, 255, 0.5);

  /* 文字 */
  --text-primary:  #f0f1f5;
  --text-secondary:#a0a4b8;
  --text-muted:    #6b6f85;
  --text-dim:      #464a60;

  /* 键帽 */
  --key-bg:        linear-gradient(180deg, #282a3d 0%, #1a1c2b 100%);
  --key-border:    1px solid rgba(255,255,255,0.12);
  --key-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset,
    0 3px 6px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0,0,0,0.2);
  --key-text:      #e8eaf5;

  /* 圆角 */
  --radius-lg:    24px;
  --radius-md:    16px;
  --radius-sm:    12px;
  --radius-pill:  100px;
  --radius-key:    8px;

  /* 阴影 */
  --shadow-card:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 20px 60px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.04);
  --shadow-glow-accent:
    0 0 30px rgba(124, 92, 255, 0.35),
    0 10px 40px rgba(0,0,0,0.4);

  /* 过渡 */
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg-base);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* ========== 背景特效 ========== */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: #7c5cff;
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: #ec4899;
  top: 20%;
  right: -150px;
  animation-delay: -7s;
}

.glow-3 {
  width: 550px;
  height: 550px;
  background: #06b6d4;
  bottom: -200px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -40px) scale(1.08); }
  66%      { transform: translate(-20px, 30px) scale(0.95); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 70%);
}

/* ========== 容器 ========== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px;
  position: relative;
  z-index: 1;
}

/* ========== 顶部导航 ========== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 56px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(124,92,255,0.4);
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ========== Hero 区 ========== */
.hero {
  text-align: center;
  margin-bottom: 44px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(124,92,255,0.1);
  border: 1px solid rgba(124,92,255,0.25);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  color: var(--accent-soft);
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 8px var(--accent-soft);
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #7c5cff 0%, #ec4899 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ========== 搜索栏 ========== */
.search-wrapper {
  max-width: 640px;
  margin: 0 auto 32px;
  position: relative;
}

.search-box {
  width: 100%;
  padding: 18px 120px 18px 56px;
  font-size: 0.98rem;
  font-family: inherit;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.search-box::placeholder {
  color: var(--text-muted);
}

.search-box:focus {
  border-color: var(--border-accent);
  background: rgba(30, 30, 50, 0.75);
  box-shadow: var(--shadow-glow-accent);
}

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

.search-box:focus ~ .search-icon {
  color: var(--accent-soft);
}

.search-hint {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kbc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: "JetBrains Mono", "SF Mono", Monaco, monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ========== 控制栏 ========== */
.control-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

/* 系统切换 */
.os-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(20px);
}

.os-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.os-btn svg {
  opacity: 0.7;
  transition: var(--transition);
}

.os-btn:hover {
  color: var(--text-primary);
}

.os-btn.active {
  background: var(--text-primary);
  color: var(--bg-base);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.os-btn.active svg {
  opacity: 1;
}

/* 分类 Tab */
.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  padding: 7px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.cat-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.04);
}

.cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(124,92,255,0.4);
}

/* ========== 分区标题 ========== */
.section-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-text {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.section-line {
  flex: 0 1 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ========== 软件图标选择区 ========== */
.software-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 14px;
  max-width: 880px;
  margin: 0 auto 48px;
  justify-items: center;
}

.sw-btn {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: var(--transition);
  overflow: visible;
  backdrop-filter: blur(10px);
}

.sw-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.12), transparent 50%);
  pointer-events: none;
}

.sw-btn:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.sw-btn.active {
  background: var(--bg-glass);
  border-color: var(--brand-color, var(--accent));
  transform: translateY(-4px);
  box-shadow:
    0 0 0 2px var(--brand-color, var(--accent)),
    0 12px 36px rgba(0,0,0,0.4),
    0 0 40px var(--brand-glow, var(--accent-glow));
}

.sw-btn .sw-emoji {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: var(--transition);
}

.sw-btn.active .sw-emoji {
  transform: scale(1.08);
}

/* SVG 图标文件（icons/*.svg），由 software.json 的 iconSvg 字段指定 */
.sw-btn .sw-icon-img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: block;
  transition: var(--transition);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.45));
  pointer-events: none;
}

.sw-btn.active .sw-icon-img {
  transform: scale(1.08);
}

.sw-btn .sw-hot {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(238,90,111,0.6);
}

.sw-btn .sw-tooltip {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,35,0.95);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  font-weight: 500;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.sw-btn:hover .sw-tooltip {
  opacity: 1;
  bottom: -38px;
}

/* ========== 快捷键面板 ========== */
.shortcut-panel {
  max-width: 880px;
  margin: 0 auto;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.shortcut-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 20%,
    rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.15) 80%,
    transparent 100%);
}

.sw-info {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sw-icon-large {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
}

/* 面板顶部的大号 SVG 图标 */
.sw-icon-large-img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.5));
}

.sw-info h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.sw-info p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ========== 分组 ========== */
.group {
  margin-bottom: 32px;
}

.group:last-child {
  margin-bottom: 0;
}

.group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-title::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ========== 快捷键条目 ========== */
.shortcut-list {
  display: grid;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.015);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.shortcut-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  transform: translateX(4px);
}

.item-desc {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 400;
}

.item-desc mark {
  background: linear-gradient(120deg, rgba(250,204,21,0.25) 0%, rgba(250,204,21,0.15) 100%);
  color: #fbbf24;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.item-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 键帽 */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  background: var(--key-bg);
  border: var(--key-border);
  border-radius: var(--radius-key);
  box-shadow: var(--key-shadow);
  font-family: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--key-text);
  white-space: nowrap;
  user-select: none;
}

.key.plus {
  background: none;
  border: none;
  box-shadow: none;
  min-width: auto;
  padding: 0 2px;
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* ========== 空 / 加载 / 错误 状态 ========== */
.empty-state,
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  opacity: 0.4;
}

.loading::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; box-shadow: 0 0 10px var(--accent); }
}

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  margin-top: 64px;
  color: var(--text-muted);
}

.footer p {
  font-size: 0.85rem;
}

.footer-sub {
  font-size: 0.78rem !important;
  margin-top: 6px;
  color: var(--text-dim) !important;
}

/* ========== 入场动画 ========== */
.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shortcut-panel .group {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.shortcut-panel .group:nth-child(1) { animation-delay: 0.05s; }
.shortcut-panel .group:nth-child(2) { animation-delay: 0.10s; }
.shortcut-panel .group:nth-child(3) { animation-delay: 0.15s; }
.shortcut-panel .group:nth-child(4) { animation-delay: 0.20s; }
.shortcut-panel .group:nth-child(5) { animation-delay: 0.25s; }
.shortcut-panel .group:nth-child(6) { animation-delay: 0.30s; }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .topbar {
    padding: 10px 14px;
    margin-bottom: 36px;
    border-radius: var(--radius-md);
  }
  .topbar-meta span:last-child { display: none; }
  .hero { margin-bottom: 28px; }
  .shortcut-panel { padding: 24px 18px; border-radius: var(--radius-md); }
  .sw-info h2 { font-size: 1.5rem; }
  .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }
  .item-keys { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .software-picker {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
  }
  .sw-btn { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 14px; }
  .sw-btn .sw-tooltip { display: none; }
  .os-btn { padding: 8px 14px; font-size: 0.82rem; }
  .key { min-width: 30px; height: 28px; padding: 0 8px; font-size: 0.75rem; }
  .search-hint { display: none; }
  .search-box { padding: 15px 20px 15px 48px; }
}

@media (max-width: 480px) {
  .software-picker {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
  }
  .sw-btn { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 12px; }
  .section-line { flex: 0 1 40px; }
  .section-text { letter-spacing: 2px; font-size: 0.7rem; }
}

/* ========== 选中态尊重软件品牌色 ========== */
/* JS 渲染时会给选中按钮设置内联变量 --brand-color / --brand-glow */
