/* =========================================================================
 * 影刀 RPA×AI 场景方案库 —— 暗色统一视觉系统
 * 暖黑墨紫底 + 高饱和霓虹点缀 + 玻璃拟态 + 流动光效
 * 目标：从首屏到卡片一个整体、零断层、有质感
 * ========================================================================= */

:root {
  /* 底色：带色彩倾向的暗底，拒绝沉闷纯蓝黑 */
  --bg: #0c0a12;
  --bg-elevated: #151020;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --panel: rgba(24, 18, 36, 0.7);
  --panel-solid: #181224;
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-strong: rgba(255, 255, 255, 0.16);

  /* 文字 */
  --text: #f6f4fb;
  --text-secondary: #b6b1c8;
  --text-faint: #6e6783;

  /* 高饱和点缀色 */
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --orange: #ffb800;
  --violet: #8b5cf6;
  --lime: #39ff14;
  --red: #ff4d6d;
  --teal: #00d4aa;
  --wine: #c41e5a;

  /* 圆角 / 阴影 / 光晕 */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --shadow-elevated: 0 32px 90px rgba(0, 0, 0, 0.55);
  --glow-cyan: 0 0 28px rgba(0, 240, 255, 0.35);
  --glow-magenta: 0 0 28px rgba(255, 43, 214, 0.35);
  --glow-violet: 0 0 28px rgba(139, 92, 246, 0.32);
  --glow-orange: 0 0 28px rgba(255, 184, 0, 0.3);

  --transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  background:
    /* 顶部墨紫光晕 */
    radial-gradient(circle at 18% 0%, rgba(139, 92, 246, 0.22), transparent 38%),
    /* 右上青蓝光晕 */
    radial-gradient(circle at 86% 12%, rgba(0, 240, 255, 0.14), transparent 32%),
    /* 底部品红光晕 */
    radial-gradient(circle at 52% 100%, rgba(255, 43, 214, 0.16), transparent 36%),
    /* 左下暖酒红光晕 */
    radial-gradient(circle at 8% 92%, rgba(196, 30, 90, 0.12), transparent 30%),
    /* 深底渐变 */
    linear-gradient(180deg, #120d1d 0%, #0c0a12 45%, #100c18 100%);
  background-attachment: fixed;
}

/* 背景彩色流动光晕层 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  will-change: transform;
}
.blob-1 {
  width: 60vw;
  height: 60vw;
  top: -18vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 65%);
  animation: float1 28s ease-in-out infinite alternate;
}
.blob-2 {
  width: 48vw;
  height: 48vw;
  top: 6vh;
  right: -14vw;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.3), transparent 60%);
  animation: float2 24s ease-in-out infinite alternate;
}
.blob-3 {
  width: 54vw;
  height: 54vw;
  bottom: -20vw;
  left: 30vw;
  background: radial-gradient(circle, rgba(255, 43, 214, 0.32), transparent 62%);
  animation: float3 32s ease-in-out infinite alternate;
}
@keyframes float1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, 4vh) scale(1.08); }
}
@keyframes float2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-5vw, 7vh) scale(1.05); }
}
@keyframes float3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4vw, -5vh) scale(1.1); }
}

/* Canvas 粒子层 */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* 玻璃面板 */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

/* 光标跟随光晕 */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.13), rgba(139, 92, 246, 0.08) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  mix-blend-mode: screen;
  filter: blur(16px);
}
.cursor-glow.active {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 184, 0, 0.16), rgba(255, 43, 214, 0.1) 40%, transparent 70%);
}

/* 顶栏 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 66px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.topbar.scrolled {
  background: rgba(15, 11, 22, 0.85);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  font-weight: 800;
  font-size: 18px;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}
.brand-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand-text i {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.stat-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
}
.stat-pill b {
  color: var(--text);
  font-weight: 700;
}

/* 主体布局 */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1640px;
  margin: 0 auto;
  padding: 96px 28px 60px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 30px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 86px;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

/* ========== AI 面板 ========== */
.ai-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(0, 240, 255, 0.05), rgba(255, 43, 214, 0.02)),
    var(--panel-solid);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ai-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.55), rgba(255, 43, 214, 0.4), rgba(255, 184, 0, 0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--panel-border);
}

.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #000;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: var(--glow-cyan);
}

.ai-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ai-name { font-weight: 700; font-size: 15px; }
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
}
.ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ai-clear {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.ai-clear:hover {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--panel-border-strong);
}

.ai-messages {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.ai-messages::-webkit-scrollbar { width: 5px; }
.ai-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

.msg {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: msgIn 0.35s ease backwards;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #000;
}
.msg.bot { align-self: flex-start; }
.msg.bot .msg-avatar { background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .msg-avatar { background: linear-gradient(135deg, var(--magenta), var(--orange)); }

.msg-body {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
}
.msg.bot .msg-body {
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.14);
  border-top-left-radius: 4px;
}
.msg.user .msg-body {
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.12), rgba(255, 184, 0, 0.08));
  border: 1px solid rgba(255, 43, 214, 0.18);
  border-top-right-radius: 4px;
}
.msg-body p { margin: 0 0 0.6em; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.msg-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.msg-body pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--panel-border);
}
.msg-body pre code { background: transparent; padding: 0; }
.msg-body ul, .msg-body ol { margin: 0.4em 0; padding-left: 1.3em; }
.msg-body li { margin-bottom: 0.25em; }
.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4 {
  margin: 0.8em 0 0.4em;
  font-weight: 700;
}
.msg-body h1 { font-size: 1.25em; }
.msg-body h2 { font-size: 1.15em; }
.msg-body h3 { font-size: 1.05em; }

.reply-text.streaming::after {
  content: "▋";
  display: inline-block;
  margin-left: 3px;
  color: var(--cyan);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: typingBounce 1.1s infinite ease-in-out both;
}
.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* AI 输入 */
.ai-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.18);
}
.ai-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.ai-form input::placeholder { color: var(--text-faint); }
.ai-form input:focus {
  border-color: rgba(0, 240, 255, 0.55);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}
.ai-form button {
  padding: 0 20px;
  border-radius: var(--radius-xs);
  border: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #000;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glow-cyan);
}
.ai-form button:hover { transform: translateY(-1px); filter: brightness(1.12); }
.ai-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* 问卷表单（AI 输出） */
.qform {
  margin: 10px 0 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--panel-border);
}
.qform-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.qform-head .qnum {
  color: var(--cyan);
  font-weight: 700;
  font-style: normal;
  margin-right: 8px;
}
.qform-head .hint {
  font-size: 11px;
  color: var(--text-faint);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
}
.qform-opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}
.opt:hover { background: rgba(255, 255, 255, 0.07); }
.opt.checked { border-color: var(--cyan); background: rgba(0, 240, 255, 0.08); }
.opt input { display: none; }
.opt .letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-strong);
  color: var(--text-secondary);
}
.opt.checked .letter { background: var(--cyan); color: #000; }
.other-wrap { margin-left: 32px; }
.other-txt {
  width: calc(100% - 32px);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 13px;
}
.other-txt:disabled { opacity: 0.5; }
.qform-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
}
.qform-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.btn-fill {
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(255, 43, 214, 0.12));
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-fill:hover { filter: brightness(1.18); }
.btn-fill.done { background: rgba(57, 255, 20, 0.15); border-color: var(--lime); }

/* ========== 筛选面板 ========== */
.filter-panel { display: flex; flex-direction: column; gap: 18px; }
.panel-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta));
}

.filter-group h3 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  font-weight: 700;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: none;
}
.filter-list.scroll {
  max-height: 146px;
  overflow-y: auto;
  padding-right: 4px;
}
.filter-list.scroll::-webkit-scrollbar { width: 5px; }
.filter-list.scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover {
  background: var(--surface-strong);
  color: var(--text);
  transform: translateY(-1px);
  border-color: var(--panel-border-strong);
}
.filter-pill.active {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #000;
  border-color: transparent;
  font-weight: 700;
  box-shadow: var(--glow-cyan);
}

/* ========== 主内容区 ========== */
.content { min-width: 0; }

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange);
  animation: pulseDot 2.2s ease-in-out infinite;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(42px, 5.6vw, 78px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -2px;
}
.hero-line { display: block; }
.hero-line.secondary {
  font-size: 0.42em;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 14px;
}
.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 30%, var(--orange) 62%, var(--violet) 92%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientMove 6s linear infinite;
  filter: drop-shadow(0 0 24px rgba(0, 240, 255, 0.18));
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

.hero-sub {
  max-width: 640px;
  margin: 0 0 32px;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-radius: var(--radius);
  max-width: 760px;
  transition: var(--transition);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}
.search-shell:focus-within {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.08), var(--glow-cyan);
}
.search-icon { color: var(--text-faint); display: flex; }
.search-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
  padding: 10px 0;
}
.search-shell input::placeholder { color: var(--text-faint); }
.search-kbd {
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 12px;
  font-family: inherit;
  transition: opacity 0.2s ease;
}
.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}
.search-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--text); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}
.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--panel-border);
}
.hero-stat b {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 45%, var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stat span { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; }

/* ========== 平台/能力跑马灯 ========== */
.ticker {
  position: relative;
  margin: 10px 0 30px;
  overflow: hidden;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  padding: 14px 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  gap: 14px;
  animation: tickerScroll 42s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ticker-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}
.ticker-item.cyan::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.ticker-item.magenta::before { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.ticker-item.orange::before { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.ticker-item.lime::before { background: var(--lime); box-shadow: 0 0 8px var(--lime); }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== 结果条 ========== */
.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.result-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 184, 0, 0.12);
  border: 1px solid rgba(255, 184, 0, 0.25);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
}
.active-chip button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--orange);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}
.active-chip button:hover { background: rgba(255, 255, 255, 0.22); }

.reset-btn {
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.reset-btn:hover { background: var(--surface-strong); color: var(--text); border-color: var(--panel-border-strong); }

/* ========== 卡片网格 ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--panel-solid);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  animation: cardIn 0.55s ease backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
  box-shadow: var(--shadow-sm);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.5), rgba(255, 43, 214, 0.35), rgba(255, 184, 0, 0.22));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: transparent;
  box-shadow: var(--shadow-elevated), 0 0 40px rgba(0, 240, 255, 0.08);
}
.card:hover::before { opacity: 1; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    520px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 240, 255, 0.12),
    transparent 42%
  );
  transition: opacity 0.25s ease;
}
.card:hover .card-glow { opacity: 1; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 1;
}
.card-domain {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--violet);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.card-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--type-color, var(--cyan));
  color: var(--type-color, var(--cyan));
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}
.card-rating {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.rating-excellent { background: rgba(57, 255, 20, 0.14); color: var(--lime); }
.rating-good { background: rgba(0, 240, 255, 0.12); color: var(--cyan); }
.rating-showcase { background: rgba(255, 43, 214, 0.14); color: var(--magenta); }
.rating-skip { background: rgba(255, 77, 109, 0.12); color: var(--red); }

.card-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  z-index: 1;
}
.card-name mark {
  background: rgba(0, 240, 255, 0.28);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.card-overview {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  z-index: 1;
}
.card-overview mark { background: rgba(255, 184, 0, 0.28); color: inherit; border-radius: 3px; padding: 0 2px; }

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  z-index: 1;
}
.card-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}
.card-action:hover { transform: translateY(-2px); filter: brightness(1.1); }
.card-action.primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.22);
}
.card-action.ask {
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.14), rgba(255, 184, 0, 0.1));
  border-color: rgba(255, 43, 214, 0.28);
  color: var(--magenta);
}
.card-action.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  z-index: 1;
}
.card-platforms {
  font-size: 12px;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-link {
  font-size: 12px;
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}

.load-more-btn {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 32px auto 0;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.load-more-btn:hover {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--panel-border-strong);
  transform: translateY(-2px);
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.empty-state p { margin: 8px 0; }
.empty-icon { color: var(--text-faint); margin-bottom: 12px; }
.empty-tip { font-size: 13px; color: var(--text-faint); }

/* ========== 详情弹窗 ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 10, 0.78);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s ease backwards;
}
.modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(255, 43, 214, 0.25), rgba(255, 184, 0, 0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: var(--transition);
}
.modal-close:hover { background: var(--surface-strong); color: var(--text); }
.modal-body {
  padding: 28px;
  overflow-y: auto;
}
.modal-head { margin-bottom: 22px; }
.modal-name {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  background: linear-gradient(90deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.modal-meta b { color: var(--text); font-weight: 600; }

.detail-section { margin-bottom: 24px; }
.detail-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.detail-section p { margin: 0; color: var(--text-secondary); line-height: 1.75; }
.detail-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-secondary);
}
.detail-list li { margin-bottom: 0.55em; }
.detail-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #000;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: var(--glow-cyan);
}
.detail-link-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.detail-link-btn:disabled { box-shadow: none; opacity: 0.5; cursor: not-allowed; }

/* ========== 页脚 ========== */
.footer {
  position: relative;
  z-index: 1;
  padding: 44px 28px;
  border-top: 1px solid var(--panel-border);
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}
.footer .brand { justify-content: center; margin-bottom: 10px; }

/* ========== 回到顶部 ========== */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 86px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: var(--transition);
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ========== AI 触发器 ========== */
.ai-trigger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #000;
  cursor: pointer;
  z-index: 95;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  border: none;
  transition: var(--transition);
}
.ai-trigger:hover { transform: scale(1.08); filter: brightness(1.12); }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 320px 1fr; }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: 86px;
  }
  .sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .ai-panel { order: -1; }
  .filter-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .panel-title { grid-column: 1 / -1; }
  .ticker { margin-bottom: 22px; }
}

@media (max-width: 720px) {
  .topbar { height: 60px; padding: 0 16px; }
  .topbar-stat { display: none; }
  .layout { padding: 78px 16px 40px; gap: 18px; }
  .hero { padding: 20px 0 28px; }
  .hero-sub { font-size: 16px; }
  .search-shell { padding: 8px 12px 8px 14px; }
  .search-kbd { display: none; }
  .filter-panel { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .modal-panel { max-height: 92vh; border-radius: var(--radius-sm); }
  .modal-body { padding: 20px; }
  .ai-trigger { display: grid; }
  .ticker-track { animation-duration: 28s; }
}

@media (min-width: 981px) {
  .ai-trigger { display: none; }
}

/* ========== 减少动效 ========== */
@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;
  }
  .cursor-glow { display: none; }
  .ticker-track { animation: none; }
}
