/* ============================================================
   goodefo cncca — 赛博霓虹夸张装饰主样式
   ============================================================ */

/* ---- CSS 自定义属性 ---- */
:root {
  --bg-deep: #050510;
  --bg-card: rgba(10, 10, 30, 0.85);
  --neon-blue: #00D4FF;
  --neon-pink: #FF2D95;
  --neon-purple: #7B2FFF;
  --neon-gold: #FFD700;
  --neon-green: #39FF14;
  --dark-purple: #1A0033;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --border-glow: rgba(0, 212, 255, 0.3);
  --search-bg: rgba(15, 15, 40, 0.9);
  --font-display: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', 'Fira Code', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: clamp(14px, 1.2vw, 18px);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- 粒子画布 ---- */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- 浮动装饰层 ---- */
#floatDecorLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---- 主容器 ---- */
.app-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   搜索首页
   ============================================================ */

.search-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100vh;
}

/* ---- 3D LOGO ---- */
.logo-3d {
  position: relative;
  margin-bottom: 0.5rem;
  perspective: 600px;
  cursor: default;
  user-select: none;
}

.logo-layer {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1;
  animation: logoFloat 4s ease-in-out infinite;
}

.logo-layer-1 {
  color: var(--neon-blue);
  text-shadow:
    0 0 10px var(--neon-blue),
    0 0 30px var(--neon-blue),
    0 0 60px var(--neon-blue),
    0 0 120px var(--neon-blue);
  transform: translateX(-50%) translateZ(0px);
  opacity: 0.9;
  animation-delay: 0s;
}

.logo-layer-2 {
  color: var(--neon-pink);
  text-shadow:
    0 0 10px var(--neon-pink),
    0 0 40px var(--neon-pink),
    0 0 80px var(--neon-pink);
  transform: translateX(-50%) translateZ(20px);
  opacity: 0.7;
  animation-delay: 0.15s;
}

.logo-layer-3 {
  color: var(--neon-purple);
  text-shadow:
    0 0 15px var(--neon-purple),
    0 0 50px var(--neon-purple),
    0 0 100px var(--neon-purple);
  transform: translateX(-50%) translateZ(40px);
  opacity: 0.5;
  animation-delay: 0.3s;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--neon-gold);
  text-shadow:
    0 0 8px var(--neon-gold),
    0 0 25px var(--neon-gold),
    0 0 50px var(--neon-gold);
  text-align: center;
  margin-top: 6.5rem;
  animation: logoSubPulse 2s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

@keyframes logoSubPulse {
  0%, 100% { opacity: 0.7; letter-spacing: 0.25em; }
  50% { opacity: 1; letter-spacing: 0.35em; }
}

/* ---- 品牌标语 ---- */
.brand-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: 0.15em;
  min-height: 1.8em;
}

.brand-tagline .char {
  display: inline-block;
  transition: color 0.3s, text-shadow 0.3s;
}

.brand-tagline .char.highlight {
  color: var(--neon-blue);
  text-shadow: 0 0 12px var(--neon-blue);
}

/* ---- 搜索框区域 ---- */
.search-box-wrapper {
  position: relative;
  width: min(90vw, 760px);
  margin-bottom: 2rem;
}

.search-box-glow {
  position: absolute;
  inset: -3px;
  border-radius: 60px;
  background: linear-gradient(
    135deg,
    var(--neon-blue),
    var(--neon-pink),
    var(--neon-purple),
    var(--neon-blue)
  );
  background-size: 400% 400%;
  animation: glowRotate 4s linear infinite;
  filter: blur(8px);
  opacity: 0.7;
  z-index: -1;
}

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

.search-form {
  position: relative;
  z-index: 1;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: var(--search-bg);
  border-radius: 60px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.3rem 0.3rem 1.4rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.search-input-group:focus-within {
  border-color: var(--neon-blue);
  box-shadow:
    0 0 20px rgba(0, 212, 255, 0.25),
    inset 0 0 20px rgba(0, 212, 255, 0.05);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.3s;
}

.search-input-group:focus-within .search-icon {
  color: var(--neon-blue);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-family: var(--font-display);
  padding: 0.65rem 0.8rem;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.search-submit-btn {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border: none;
  border-radius: 50px;
  padding: 0.7rem 2rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
}

.search-submit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.search-submit-btn:active {
  transform: scale(0.96);
}

.btn-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}

.btn-glitch {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-pink);
  letter-spacing: 0.1em;
  opacity: 0;
  clip-path: inset(0 0 50% 0);
  animation: btnGlitch 3s infinite;
}

@keyframes btnGlitch {
  0%, 90%, 100% { opacity: 0; transform: translate(0, 0); }
  92% { opacity: 0.8; transform: translate(2px, -1px); }
  94% { opacity: 0; transform: translate(-2px, 1px); }
}

/* ---- 关键词云 ---- */
.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  max-width: 700px;
  padding: 0 1rem;
}

.keyword-cloud .kw-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.keyword-cloud .kw-tag:hover {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
}

/* ============================================================
   结果页
   ============================================================ */

.result-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.result-page.hidden {
  display: none;
}

/* ---- 顶部搜索栏 ---- */
.result-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: rgba(5, 5, 16, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.result-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--neon-blue);
  text-shadow: 0 0 10px var(--neon-blue);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.result-logo:hover {
  transform: scale(1.05);
}

.logo-accent {
  color: var(--neon-gold);
  text-shadow: 0 0 8px var(--neon-gold);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin-left: 0.15em;
}

.result-search-form {
  flex: 1;
  max-width: 600px;
}

.result-search-group {
  display: flex;
  align-items: center;
  background: var(--search-bg);
  border-radius: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.15rem 0.15rem 1rem;
  transition: border-color 0.3s;
}

.result-search-group:focus-within {
  border-color: var(--neon-blue);
}

.result-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-display);
  padding: 0.5rem 0.5rem;
  min-width: 0;
}

.result-search-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}

.result-search-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ---- 结果容器 ---- */
.results-container {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* ---- 搜索结果卡片 ---- */
.result-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--neon-blue), var(--neon-pink));
  opacity: 0;
  transition: opacity 0.3s;
}

.result-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateX(6px);
  box-shadow: 0 4px 30px rgba(0, 212, 255, 0.1);
}

.result-card:hover::before {
  opacity: 1;
}

.result-card .result-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-green);
  opacity: 0.7;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.result-card .result-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-card .result-title a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: text-shadow 0.3s;
}

.result-card .result-title a:hover {
  text-shadow: 0 0 15px var(--neon-blue);
  text-decoration: underline;
}

.result-card .result-title a:visited {
  color: var(--neon-purple);
}

.result-card .result-snippet {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.result-card .result-snippet em {
  font-style: normal;
  color: var(--neon-pink);
  font-weight: 600;
  text-shadow: 0 0 6px rgba(255, 45, 149, 0.4);
}

/* ---- 图片搜索结果 ---- */
.result-card.image-card {
  display: inline-block;
  width: calc(33.333% - 1rem);
  margin-right: 0.8rem;
  vertical-align: top;
  padding: 0.6rem;
  text-align: center;
}

.result-card.image-card .result-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.result-card.image-card:hover .result-thumb {
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* ---- 分页 ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem 3rem;
  flex-wrap: wrap;
}

.pagination.hidden {
  display: none;
}

.pagination .page-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination .page-btn:hover {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.pagination .page-btn.active {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---- 空状态 ---- */
.empty-state,
.error-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state.hidden,
.error-state.hidden {
  display: none;
}

.empty-title,
.error-title {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--neon-blue);
  text-shadow: 0 0 15px var(--neon-blue);
  margin: 1.5rem 0 0.8rem;
}

.error-title {
  color: var(--neon-pink);
  text-shadow: 0 0 15px var(--neon-pink);
}

.empty-desc,
.error-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 400px;
  line-height: 1.6;
}

.retry-btn {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: transparent;
  color: var(--neon-blue);
  border: 1px solid var(--neon-blue);
  border-radius: 50px;
  padding: 0.6rem 2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.retry-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* ---- 底部 ---- */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 1.5rem 2rem;
  text-align: center;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-pink), transparent);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ---- 通用工具类 ---- */
.hidden {
  display: none !important;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .search-page {
    padding: 1.5rem 1rem;
  }

  .result-header {
    padding: 0.8rem 1rem;
    gap: 0.8rem;
  }

  .result-logo {
    font-size: 1.2rem;
  }

  .results-container {
    padding: 1rem 1rem 2rem;
  }

  .result-card.image-card {
    width: calc(50% - 0.6rem);
  }

  .search-submit-btn {
    padding: 0.65rem 1.4rem;
  }

  .btn-text {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .logo-layer {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .logo-sub {
    margin-top: 4.5rem;
    font-size: 1rem;
  }

  .search-box-wrapper {
    width: 95vw;
  }

  .result-card.image-card {
    width: 100%;
    margin-right: 0;
  }

  .pagination .page-btn {
    min-width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }
}

/* ---- 无障碍：减少动画 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 焦点可见 ---- */
:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
  border-radius: 4px;
}
