/* ==========================================================================
   APIGOTO 门户静态版全局样式
   来源：Portalweb (Vue3) App.vue 全局 + TopNav.vue + AnnouncementPopup.vue
        + HomeView.vue 公共部分（按钮/段落标签/QR侧边栏/客服/页脚）
   页面级样式见 home.css / auth.css / rankings.css / playground.css /
   feedback.css / promo.css
   ========================================================================== */

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

html {
  /* 首页锚点（/#pricing 等）平滑滚动，并为固定导航让出偏移 */
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #e8e8ed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------------- Navbar（TopNav.vue） ---------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #23233a;
}
.nav-content { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a {
  font-size: 14px;
  color: #b0b0c0;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: #ffffff; }
.nav-auth { display: flex; align-items: center; gap: 12px; margin-left: 12px; }
.btn-login { color: #e8e8ed !important; }
.btn-register,
.btn-backend {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
}
.btn-promo {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-promo:hover {
  background: linear-gradient(135deg, #d97706, #dc2626);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span { display: block; width: 22px; height: 2px; background: #e8e8ed; }
@media (max-width: 1100px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(10, 10, 15, 0.98);
    border-bottom: 1px solid #23233a;
  }
  .nav-links.open { display: flex; }
  .nav-auth { margin-left: 0; }
  .mobile-toggle { display: flex; }
}

/* ---------------- 通用按钮 / 段落标签（HomeView.vue） ---------------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 32px; border-radius: 8px; background: #6366f1; color: white;
  font-size: 16px; font-weight: 600; transition: all 0.2s; border: none; cursor: pointer;
}
.btn-primary:hover { background: #818cf8; box-shadow: 0 0 20px rgba(99, 102, 241, 0.15); }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 32px; border-radius: 8px; background: transparent; color: #e8e8ed;
  font-size: 16px; font-weight: 600; border: 1px solid #23233a; transition: all 0.2s; cursor: pointer;
}
.btn-outline:hover { border-color: #5c5c72; background: #16161f; }
.full-width { width: 100%; }
.section-label {
  display: inline-block; padding: 4px 12px; background: rgba(99, 102, 241, 0.1);
  color: #6366f1; font-size: 13px; font-weight: 600; border-radius: 100px; margin-bottom: 16px;
}
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.section-header p { font-size: 16px; color: #8b8b9e; max-width: 600px; margin: 0 auto; }

/* ---------------- 页脚（HomeView.vue） ---------------- */
.footer { padding: 60px 0 0; border-top: 1px solid #23233a; background: #111118; }
.footer-content { display: flex; justify-content: space-between; gap: 48px; padding-bottom: 40px; }
.footer-brand { max-width: 280px; }
.footer-brand p { font-size: 14px; color: #8b8b9e; margin-top: 8px; }
.footer-links { display: flex; gap: 64px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 14px; color: #8b8b9e; padding: 4px 0; }
.footer-col a:hover { color: #e8e8ed; }
.footer-bottom { padding: 20px 0; border-top: 1px solid #23233a; }
.footer-bottom p { font-size: 12px; color: #5c5c72; text-align: center; }
@media (max-width: 768px) {
  .footer-content { flex-direction: column; }
  .footer-links { flex-wrap: wrap; gap: 32px; }
}

/* ---------------- QR 侧边栏 / 在线客服（HomeView.vue） ---------------- */
.qr-sidebar { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 90; display: flex; flex-direction: column; }
.qr-toggle {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; background: #6366f1; color: white; cursor: pointer;
  border-radius: 8px 0 0 8px; writing-mode: vertical-rl; transition: background 0.2s;
}
.qr-toggle:hover { background: #818cf8; }
.qr-icon { font-size: 18px; }
.qr-text { font-size: 12px; letter-spacing: 2px; }
.qr-panel {
  display: none; position: absolute; right: 100%; top: 0; background: #16161f;
  border: 1px solid #23233a; border-radius: 12px 0 0 12px; padding: 16px;
  flex-direction: column; align-items: center; gap: 16px;
}
.qr-panel.open { display: flex; }
.qr-item { display: flex; flex-direction: column; align-items: center; width: 100%; }
.qr-item img { width: 130px; height: 130px; object-fit: contain; border-radius: 8px; border: 1px solid #23233a; background: #fff; padding: 4px; }
.qr-item span { font-size: 12px; color: #8b8b9e; margin-top: 6px; }
.cs-sidebar { position: fixed; right: 0; top: calc(50% + 160px); z-index: 90; }
.cs-button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; background: #22c55e; color: white; cursor: pointer;
  border-radius: 8px 0 0 8px; writing-mode: vertical-rl; transition: background 0.2s; text-decoration: none;
}
.cs-button:hover { background: #16a34a; }
.cs-icon { font-size: 18px; }
.cs-text { font-size: 12px; letter-spacing: 2px; }
.cs-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.cs-overlay[hidden] { display: none; }
.cs-panel { background: #fff; border-radius: 12px; padding: 24px; width: 300px; text-align: center; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18); }
.cs-qr { width: 220px; height: 220px; object-fit: contain; border-radius: 8px; }
.cs-title { margin-top: 12px; font-size: 16px; font-weight: 600; color: #1f2329; }
.cs-desc { margin-top: 4px; font-size: 13px; color: #8a8f99; }
.cs-close { margin-top: 16px; padding: 8px 32px; border: none; border-radius: 6px; background: #3a6ff7; color: #fff; font-size: 14px; cursor: pointer; }
.cs-close:hover { background: #2f5fe0; }
@media (max-width: 768px) {
  .qr-sidebar { display: none; }
  .cs-sidebar { display: none; }
}

/* ---------------- 公告弹窗（AnnouncementPopup.vue） ---------------- */
.ann-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.ann-dialog {
  width: min(480px, calc(100vw - 48px)); max-height: 70vh;
  display: flex; flex-direction: column; padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px;
  background: #16161f; color: #e8e8ed; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.ann-title { margin-bottom: 14px; font-size: 18px; font-weight: 700; }
.ann-content { flex: 1; overflow-y: auto; font-size: 14px; line-height: 1.7; color: #b8b8c4; white-space: pre-wrap; }
.ann-btn {
  margin-top: 20px; align-self: flex-end; padding: 8px 22px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 14px; cursor: pointer;
}
.ann-btn:hover { opacity: 0.9; }

/* ---------------- toast 轻提示（common.js Portal.toast） ---------------- */
.portal-toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 1000; padding: 10px 22px;
  background: rgba(17, 17, 27, 0.95); color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35); border-radius: 8px; font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.portal-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
