@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@400;600;700;800&family=DM+Mono:wght@400;500&display=swap");

:root {
  /* 品牌调色板 */
  --bg: #FAF6FF;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-tile: #F4EFFC;
  --ink-primary: #2B2347;
  --ink-secondary: #655C82;
  --ink-tertiary: #928AA8;

  /* 学园偶像主题强调色 */
  --sky-main: #3CA5DB;
  --sky-gradient: linear-gradient(135deg, #4EBBEF 0%, #2993CC 100%);
  --sky-light: #EBF6FC;
  --sky-glow: rgba(60, 165, 219, 0.35);

  --pink-main: #FA6B9D;
  --pink-gradient: linear-gradient(135deg, #FF82B2 0%, #F55589 100%);
  --pink-light: #FDF0F5;
  --pink-glow: rgba(250, 107, 157, 0.35);

  --gold-main: #FFB300;
  --gold-glow: rgba(255, 179, 0, 0.35);
  --mint-main: #27AE60;

  /* 边框与阴影 */
  --border-subtle: rgba(225, 215, 245, 0.8);
  --border-focus: #3CA5DB;
  --shadow-sm: 0 2px 8px rgba(100, 75, 140, 0.04);
  --shadow-md: 0 8px 24px rgba(100, 75, 140, 0.08), 0 2px 6px rgba(100, 75, 140, 0.03);
  --shadow-lg: 0 16px 40px rgba(100, 75, 140, 0.12), 0 4px 12px rgba(100, 75, 140, 0.04);

  /* 圆角规范 */
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 9999px;

  color: var(--ink-primary);
  background-color: var(--bg);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #FFD2E5;
  color: var(--ink-primary);
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ---------- 舞台流动氛围光晕 ---------- */
.glow-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: floatSlow 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 480px;
  height: 480px;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, #FFB0D2, rgba(255, 176, 210, 0));
}

.blob-2 {
  width: 520px;
  height: 520px;
  top: 25%;
  left: -150px;
  background: radial-gradient(circle, #A5E0FA, rgba(165, 224, 250, 0));
  animation-delay: -6s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  bottom: 5%;
  right: 15%;
  background: radial-gradient(circle, #FFE59E, rgba(255, 229, 158, 0));
  animation-delay: -12s;
}

@keyframes floatSlow {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(30px) scale(1.08); }
  100% { transform: translateY(-20px) scale(0.95); }
}

/* ---------- 顶栏导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 246, 255, 0.82);
  border-bottom: 1px solid rgba(225, 215, 245, 0.6);
  padding: env(safe-area-inset-top, 0px) 0 0;
}

.header-container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink-primary);
  touch-action: manipulation;
}

.brand-star {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #FFF6D6, #FFE28A);
  color: var(--gold-main);
  border: 1.5px solid rgba(255, 179, 0, 0.5);
  border-radius: 50%;
  font-size: 15px;
  box-shadow: 0 2px 8px var(--gold-glow);
  transition: transform 0.25s ease;
}

.brand:hover .brand-star,
.brand:active .brand-star {
  transform: rotate(72deg) scale(1.1);
}

.brand-name {
  font: 800 17px "Baloo 2", "Nunito", sans-serif;
  letter-spacing: 0.04em;
}
.brand-name em {
  font-style: normal;
  color: var(--pink-main);
  margin-left: 2px;
}

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

.edge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font: 700 11px "DM Mono", monospace;
  color: var(--ink-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-main);
  box-shadow: 0 0 6px rgba(39, 174, 96, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.nav-api-btn {
  text-decoration: none;
  font: 700 11px "DM Mono", monospace;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, var(--sky-main), var(--pink-main));
  padding: 6px 14px;
  border-radius: var(--r-pill);
  box-shadow: 0 3px 10px rgba(60, 165, 219, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.nav-api-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(250, 107, 157, 0.45);
}

.nav-api-btn:active {
  transform: scale(0.96);
}

/* ---------- 主体内容区 ---------- */
.main-content {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 44px) 0 clamp(48px, 8vw, 80px);
}

/* ---------- Hero 标头区 ---------- */
.hero-section {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(28px, 6vw, 48px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1.5px solid rgba(250, 107, 157, 0.4);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font: 700 11px "DM Mono", monospace;
  letter-spacing: 0.12em;
  color: var(--pink-main);
  box-shadow: 0 2px 10px rgba(250, 107, 157, 0.15);
  margin-bottom: 14px;
}

.hero-badge .star-icon {
  color: var(--gold-main);
  font-size: 13px;
}

.hero-title {
  margin: 0 0 12px;
  font: 800 clamp(2.3rem, 7vw, 3.8rem)/1.12 "Baloo 2", "Nunito", sans-serif;
  letter-spacing: -0.01em;
}

.gradient-text {
  background: linear-gradient(135deg, #2D9CDB 0%, #FA6B9D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 auto;
  font-size: clamp(14.5px, 3.5vw, 16.5px);
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 540px;
}

/* ---------- 核心分发工作台 (Hub Container) ---------- */
.hub-container {
  margin-bottom: clamp(36px, 7vw, 56px);
}

/* 移动端标签切换条 */
.hub-tab-bar {
  display: none;
  background: rgba(235, 226, 250, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  padding: 4px;
  margin: 0 auto 20px;
  max-width: 440px;
  backdrop-filter: blur(12px);
}

.hub-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font: 800 13.5px "Baloo 2", "Nunito", sans-serif;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
}

.hub-tab.active {
  background: #fff;
  color: var(--ink-primary);
  box-shadow: 0 4px 14px rgba(100, 75, 140, 0.12);
}

.tab-icon {
  font-size: 15px;
}

.tab-badge {
  font: 700 9px "DM Mono", monospace;
  padding: 2px 6px;
  border-radius: var(--r-pill);
}

/* 双面板网格布局 */
.hub-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 3vw, 26px);
  align-items: stretch;
  min-width: 0;
}

/* 面板主体卡片 */
.hub-panel {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 4vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-width: 0;
  max-width: 100%;
}

.hub-panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.hub-panel.panel-apk {
  border-top: 4px solid var(--sky-main);
}

.hub-panel.panel-trans {
  border-top: 4px solid var(--pink-main);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 10.5px "DM Mono", monospace;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.tag-dot.sky {
  background: var(--sky-main);
  box-shadow: 0 0 6px var(--sky-glow);
}
.tag-dot.pink {
  background: var(--pink-main);
  box-shadow: 0 0 6px var(--pink-glow);
}

.panel-star {
  color: var(--gold-main);
  font-size: 16px;
  opacity: 0.85;
}

/* 加载状态与 Spinner */
.card-state {
  margin: 28px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: var(--ink-secondary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(146, 138, 168, 0.2);
  border-top-color: var(--sky-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

.panel-trans .spinner {
  border-top-color: var(--pink-main);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.card-state.failure {
  color: #D32F2F;
  font-weight: 700;
}
.card-state.failure .spinner {
  display: none;
}

/* 版本与胶囊行 */
.version-badge-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.version-tag {
  font: 800 clamp(2.2rem, 5.5vw, 3.1rem)/1 "Baloo 2", "Nunito", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.pill {
  font: 700 10px "DM Mono", monospace;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  vertical-align: middle;
}

.pill-sky {
  color: #01579B;
  background: var(--sky-light);
  border: 1px solid rgba(60, 165, 219, 0.35);
}

.pill-pink {
  color: #880E4F;
  background: var(--pink-light);
  border: 1px solid rgba(250, 107, 157, 0.35);
}

/* 3 格元数据磁贴网格 */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.8vw, 12px);
  margin-bottom: 22px;
}

.meta-item {
  background: var(--bg-tile);
  border: 1px solid rgba(225, 215, 245, 0.6);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.meta-label {
  font: 700 9.5px "DM Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: 3px;
}

.meta-value {
  font-size: clamp(12px, 2.6vw, 13.5px);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-all;
  min-height: 32px;
  display: flex;
  align-items: center;
}

/* 行动按钮 */
.action-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  text-decoration: none;
  color: #fff;
  font: 800 clamp(15.5px, 3.6vw, 17px) "Baloo 2", "Nunito", sans-serif;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  touch-action: manipulation;
  user-select: none;
}

.btn-sky {
  background: var(--sky-gradient);
  box-shadow: 0 6px 18px var(--sky-glow);
}

.btn-pink {
  background: var(--pink-gradient);
  box-shadow: 0 6px 18px var(--pink-glow);
}

.action-btn:hover {
  transform: translateY(-2px);
}
.btn-sky:hover {
  box-shadow: 0 10px 24px rgba(60, 165, 219, 0.5);
}
.btn-pink:hover {
  box-shadow: 0 10px 24px rgba(250, 107, 157, 0.5);
}

.action-btn:active {
  transform: scale(0.975);
  filter: brightness(0.96);
}

.btn-icon {
  font-size: 20px;
  line-height: 0;
  color: #FFF3CC;
  transition: transform 0.2s ease;
}

.action-btn:hover .btn-icon,
.action-btn:active .btn-icon {
  transform: translateY(2px);
}

/* 校验码与来源提示行 */
.checksum-container {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-secondary);
  min-width: 0;
  max-width: 100%;
}

.checksum-label {
  font: 700 10px "DM Mono", monospace;
  color: var(--ink-tertiary);
  flex: none;
}

.copyable-hash {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--ink-primary);
  background: var(--bg-tile);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  flex: 1;
}

.copyable-hash:hover {
  border-color: var(--sky-main);
  background: #E8E2F5;
}

.copyable-hash:active {
  background: #DCD4EF;
}

.upstream-text {
  font-size: 11px;
}
.upstream-text code {
  font-family: "DM Mono", monospace;
  color: var(--pink-main);
  font-weight: 700;
}

/* ---------- 3 步配置导引区 (Guide Section) ---------- */
.guide-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4.5vw, 36px);
  box-shadow: var(--shadow-md);
}

.section-title-row {
  margin-bottom: 24px;
}

.section-title {
  margin: 0 0 4px;
  font: 800 clamp(1.4rem, 4vw, 1.8rem) "Baloo 2", "Nunito", sans-serif;
  color: var(--ink-primary);
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--ink-tertiary);
  font-weight: 600;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 20px);
}

.step-card {
  background: var(--bg-tile);
  border: 1px solid rgba(225, 215, 245, 0.7);
  border-radius: var(--r-lg);
  padding: clamp(16px, 3vw, 22px);
  display: flex;
  flex-direction: column;
}

.step-card.highlight {
  background: #FFF8FA;
  border-color: rgba(250, 107, 157, 0.4);
}

.step-badge {
  display: inline-block;
  align-self: flex-start;
  font: 800 10px "DM Mono", monospace;
  letter-spacing: 0.08em;
  color: var(--sky-main);
  background: rgba(60, 165, 219, 0.12);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}

.step-badge.pink {
  color: var(--pink-main);
  background: rgba(250, 107, 157, 0.12);
}

.step-title {
  margin: 0 0 8px;
  font: 800 16px "Baloo 2", "Nunito", sans-serif;
  color: var(--ink-primary);
}

.step-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
  flex: 1;
}

/* 终端样式地址复制框 */
.code-copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: #fff;
  border: 1.5px solid rgba(250, 107, 157, 0.3);
  border-radius: var(--r-md);
  padding: 6px 8px 6px 12px;
  box-shadow: 0 2px 8px rgba(250, 107, 157, 0.08);
}

.code-url {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--ink-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}

.btn-copy-chip {
  flex: none;
  background: linear-gradient(135deg, #FF82B2, #FA6B9D);
  border: none;
  color: #fff;
  font: 800 11px "Baloo 2", "Nunito", sans-serif;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(250, 107, 157, 0.3);
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.btn-copy-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(250, 107, 157, 0.45);
}

.btn-copy-chip:active {
  transform: scale(0.95);
}

.btn-copy-chip.copied {
  background: var(--mint-main);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

/* ---------- 复制成功轻提示 (Toast) ---------- */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--ink-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  font: 700 13px "Baloo 2", "Nunito", sans-serif;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(43, 35, 71, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid rgba(225, 215, 245, 0.6);
  padding: 28px 16px max(28px, env(safe-area-inset-bottom, 28px));
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 600 10.5px "DM Mono", monospace;
  letter-spacing: 0.14em;
  color: var(--ink-tertiary);
}

.footer-star {
  color: var(--gold-main);
  font-size: 11px;
}

/* ---------- 移动端响应式 (Mobile Optimization) ---------- */
@media (max-width: 860px) {
  .guide-steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .header-actions .edge-status {
    display: none;
  }

  .hub-tab-bar {
    display: flex;
  }

  .hub-panels {
    grid-template-columns: 1fr;
  }

  /* 移动端通过标签栏聚焦激活的面板 */
  .hub-panel {
    display: none;
    border-radius: var(--r-lg);
    padding: 20px 18px 22px;
  }

  .hub-panel.active {
    display: flex;
  }

  .guide-section {
    padding: 20px 18px;
    border-radius: var(--r-lg);
  }

  .code-copy-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .code-url {
    white-space: normal;
    word-break: break-all;
  }

  .btn-copy-chip {
    align-self: flex-end;
    padding: 5px 14px;
  }
}

@media (max-width: 480px) {
  .main-content {
    width: calc(100% - 24px);
    padding-top: 18px;
  }

  .hero-title {
    font-size: 2.3rem;
  }

  .meta-grid {
    gap: 6px;
  }
  .meta-item {
    padding: 8px;
  }
  .meta-value {
    font-size: 11.5px;
    min-height: 28px;
  }

  .action-btn {
    padding: 13px 18px;
    min-height: 48px;
  }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
