/* ==========================================================================
   GEO Radar — Floating Pre-Sale Advisor Widget
   纯前端 · 零依赖 · 零 API · 零月租
   ========================================================================== */

/* ---------- 1. CENTRAL GUMROAD LINK CONFIG (替换真实链接只改这里) ---------- */
:root {
  --graz-accent: #10b981;
  --graz-accent-2: #06b6d4;
  --graz-bg: #04120f;
  --graz-bg-2: #06201a;
  --graz-border: rgba(16, 185, 129, 0.38);
  --graz-text: #e8fff8;
  --graz-muted: #8fb8ad;
}

/* ---------- 2. 悬浮胶囊按钮 ---------- */
.graz-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--graz-border);
  background: linear-gradient(135deg, var(--graz-bg-2), var(--graz-bg));
  color: var(--graz-text);
  font: 600 14px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.22), 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
}
.graz-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(16, 185, 129, 0.34), 0 2px 10px rgba(0, 0, 0, 0.6);
}
.graz-launcher:focus-visible {
  outline: 2px solid var(--graz-accent-2);
  outline-offset: 3px;
}
.graz-launcher .graz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--graz-accent);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: graz-pulse 2.4s infinite;
}
@keyframes graz-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70%  { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.graz-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }

/* ---------- 3. 面板 ---------- */
.graz-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483001;
  width: min(400px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 40px));
  display: none;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--graz-border);
  background: linear-gradient(180deg, #051915 0%, #030d0b 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(6, 182, 212, 0.12);
  color: var(--graz-text);
  font: 400 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  animation: graz-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.graz-panel.is-open { display: flex; }
@keyframes graz-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 头部 */
.graz-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.18);
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.1), transparent);
  flex-shrink: 0;
}
.graz-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.graz-head .graz-sub {
  font-size: 11.5px;
  color: var(--graz-muted);
  margin-top: 1px;
}
.graz-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: transparent;
  color: var(--graz-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.graz-close:hover { color: var(--graz-text); border-color: var(--graz-border); }

/* Tab 切换 */
.graz-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  flex-shrink: 0;
}
.graz-tab {
  flex: 1;
  padding: 9px 8px;
  border-radius: 9px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: rgba(6, 182, 212, 0.05);
  color: var(--graz-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.graz-tab[aria-selected="true"] {
  border-color: var(--graz-accent);
  background: rgba(16, 185, 129, 0.14);
  color: var(--graz-text);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}

/* 内容区 */
.graz-body {
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}
.graz-body::-webkit-scrollbar { width: 8px; }
.graz-body::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: 4px;
}
.graz-view { display: none; }
.graz-view.is-active { display: block; }

/* ---------- Tab1 套餐查找 ---------- */
.graz-q { font-size: 13px; color: var(--graz-muted); margin: 0 0 10px; }
.graz-goal {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  margin-bottom: 8px;
  border-radius: 11px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(6, 182, 212, 0.05);
  color: var(--graz-text);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.16s ease;
}
.graz-goal:hover {
  border-color: var(--graz-accent);
  background: rgba(16, 185, 129, 0.1);
  transform: translateX(2px);
}
.graz-goal.is-selected {
  border-color: var(--graz-accent-2);
  background: rgba(6, 182, 212, 0.14);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3);
}

/* 推荐结果卡 */
.graz-rec {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--graz-accent);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.13), rgba(6, 182, 212, 0.06));
  animation: graz-in 0.24s ease;
}
.graz-rec .graz-rec-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--graz-accent);
  margin-bottom: 5px;
}
.graz-rec h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.graz-rec .graz-price {
  font-size: 13px;
  color: var(--graz-accent-2);
  font-weight: 600;
  margin-bottom: 7px;
}
.graz-rec p {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--graz-muted);
  line-height: 1.55;
}

/* ---------- CTA 按钮（每个回答卡片底部必须紧跟） ---------- */
.graz-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--graz-accent), var(--graz-accent-2));
  color: #01231a;
  font-size: 13.5px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: filter 0.16s ease, transform 0.16s ease;
}
.graz-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ---------- Tab2 秒答 ---------- */
.graz-search {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  background: rgba(0, 0, 0, 0.35);
  color: var(--graz-text);
  font-size: 13px;
  box-sizing: border-box;
}
.graz-search::placeholder { color: #5f857a; }
.graz-search:focus {
  outline: none;
  border-color: var(--graz-accent-2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.14);
}

.graz-qa {
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 11px;
  margin-bottom: 8px;
  overflow: hidden;
  background: rgba(6, 182, 212, 0.035);
}
.graz-qa[hidden] { display: none; }
.graz-qa-q {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--graz-text);
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.graz-qa-q:hover { background: rgba(16, 185, 129, 0.07); }
.graz-qa-q .graz-caret {
  margin-left: auto;
  color: var(--graz-accent-2);
  font-size: 11px;
  transition: transform 0.18s ease;
  flex-shrink: 0;
  padding-top: 2px;
}
.graz-qa.is-open .graz-caret { transform: rotate(180deg); }

.graz-qa-a {
  display: none;
  padding: 0 12px 12px;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--graz-muted);
}
.graz-qa.is-open .graz-qa-a { display: block; }
.graz-qa-a p { margin: 0 0 10px; }
.graz-qa-a strong { color: var(--graz-text); font-weight: 650; }
.graz-qa-a .graz-cta { margin-top: 4px; }

.graz-empty {
  padding: 22px 10px;
  text-align: center;
  color: var(--graz-muted);
  font-size: 12.5px;
}

/* ---------- 4. 移动端适配（不遮挡首屏 CTA） ---------- */
@media (max-width: 640px) {
  .graz-launcher {
    right: 14px;
    bottom: 14px;
    padding: 10px 15px;
    font-size: 13px;
  }
  .graz-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .graz-launcher,
  .graz-panel,
  .graz-rec,
  .graz-goal { animation: none !important; transition: none !important; }
  .graz-launcher .graz-dot { animation: none !important; }
}
