/* ============================================
   应用坞 - 全局样式变量 & 基础组件
   ============================================ */

:root {
  /* 品牌色（科技蓝 #1677FF） */
  --accent-orange: #1677FF;
  --accent-orange-light: #4096FF;
  --primary-light: #69B1FF;
  --primary-deep: #0958D9;
  --brand-soft-bg: #EEF4FE;

  /* 画布与卡片 */
  --bg-body: #F5F6FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FAFBFC;
  --bg-header: #1677FF;

  /* 分割线 */
  --border-color: #E5E7EB;
  --border-light: #F0F2F5;

  /* 文字 */
  --text-primary: #333333;
  --text-secondary: #888888;
  --text-tertiary: #999999;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* 过渡 */
  --transition-fast: 0.2s ease;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* //【新增亮色/暗色全局主题变量】全站统一配色切换 */
[data-theme="dark"] {
  --accent-orange: #4096FF;
  --accent-orange-light: #69B1FF;
  --primary-light: #69B1FF;
  --primary-deep: #1677FF;
  --bg-body: #1a1a2e;
  --bg-card: #252540;
  --bg-sidebar: #1e1e32;
  --bg-header: #1677FF;
  --border-color: #3a3a55;
  --border-light: #2e2e48;
  --text-primary: #e0e0e0;
  --text-secondary: #999;
  --text-tertiary: #777;
  --brand-soft-bg: #1a2a40;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
}
[data-theme="dark"] .starry-header {
  background: linear-gradient(135deg, #0d0d1a 0%, #111128 50%, #0a0a20 100%);
}

/* ========== 全局重置 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.5;
  min-height: 100vh;
  padding-top: 44px; /* //为顶部固定栏预留空间 */
}

/* //【顶部配色修复】统一导航栏与网站星空深蓝色主题，消除配色不协调问题 */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  height: 44px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.top-bar.scrolled {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
[data-theme="dark"] .top-bar.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.top-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}
/* //【修复】LOGO扳手图标橙色 */
.top-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
  color: #FF6B35;
  transition: opacity 0.2s ease;
}
.top-logo-icon {
  color: #FF6B35;
  flex-shrink: 0;
}
.top-logo:hover {
  opacity: 0.8;
}
.top-bar-spacer {
  flex: 1;
}
/* //【修复】顶部按钮白色图标，适配深蓝背景 */
.top-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  transition: all 0.2s ease;
}
.top-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #FF6B35;
}
/* //【修复】网站提交按钮，圆形橙色边框 */
.top-submit-btn {
  padding: 5px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,107,53,0.5);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.top-submit-btn:hover {
  background: rgba(255,107,53,0.15);
  border-color: #FF6B35;
  color: #FF6B35;
}
/* //【新增侧边栏隐藏自适应布局样式】 */
body.sidebar-hidden .sidebar {
  display: none !important;
}
body.sidebar-hidden .main-content {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

input {
  border: none;
  outline: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ========== 通用工具类 ========== */
.text-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ========== 加载旋转器 ========== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Toast 提示 ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #fff;
  animation: toastIn 0.25s ease;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}
.toast-success { background: #10B981; }
.toast-error { background: #EF4444; }
.toast-info { background: var(--accent-orange); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== 软件卡悬停提示框 (Tooltip) ========== */
.tooltip-box {
  position: fixed;
  z-index: 9998;
  max-width: 300px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tooltip-box.show {
  opacity: 1;
}

/* ========== 下载弹窗 ========== */
.download-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.download-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.download-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 560px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.dialog-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.dialog-close:hover {
  background: var(--accent-orange);
  color: #fff;
}
/* //【下载弹窗头部样式新增】软件图标+名称+简介信息展示区块 */
.dl-sw-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--bg-body);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--border-light);
}
.dl-sw-header-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center;
  justify-content: center; overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dl-sw-header-icon img {
  width: 100%; height: 100%; object-fit: cover;
}
.dl-sw-header-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 4px;
}
.dl-sw-header-name {
  font-size: 17px; font-weight: 700;
  color: var(--text-primary); line-height: 1.3;
}
.dl-sw-header-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.version-block {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-body);
  border-radius: var(--radius-md);
}
.version-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.channel-row + .channel-row {
  border-top: 1px solid var(--border-light);
}
.channel-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 56px;
}
.channel-url-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.channel-url-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}
.extract-code-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.extract-code-label { color: var(--text-secondary); }
.extract-code-val {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--border-light);
  color: var(--accent-orange);
  font-weight: 600;
  font-family: monospace;
  cursor: pointer;
  user-select: all;
}
.copy-code-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent-orange);
  color: #fff;
  transition: all var(--transition-fast);
}
.copy-code-btn:hover { filter: brightness(1.1); }
.copy-code-btn.copied { background: #10B981; }
.no-channels-text {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* //【新增FAQ折叠问答样式】适配右侧栏统一视觉，复用现有help-item结构 */
.faq-item {
  cursor: default;
}
.faq-q {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}
.faq-q:hover {
  color: var(--accent-orange);
}
.faq-arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item.open .faq-arrow {
  transform: rotate(90deg);
}
.faq-a {
  display: none;
  padding-top: 6px;
}
.faq-item.open .faq-a {
  display: block;
}

/* ============================================
   //【底部栏新增样式】声明文字按钮、微信图标、联系邮箱布局与交互、双主题配色适配
   ============================================ */

/* 声明文字按钮样式（复用 footer-col a 排版，增加下划线hover提示） */
/* //【修复底部按钮点击拦截】显式 cursor + active 视觉反馈 */
.footer-decl-link {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.footer-decl-link:active {
  opacity: 0.6;
}

/* 微信社群图标链接 */
.footer-wx-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #8D97A8;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition-fast);
}
.footer-wx-link:hover {
  color: #07C160;
}
/* //【修复底部按钮点击拦截】微信图标 active 视觉反馈 */
.footer-wx-link:active {
  opacity: 0.6;
}
.footer-wx-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 联系邮箱文字 — 可复制 */
.footer-divider span:last-child {
  user-select: all;
  cursor: text;
}

/* 暗色主题下微信图标hover保持微信绿 */
[data-theme="dark"] .footer-wx-link:hover {
  color: #07C160;
}

/* ============================================
   //【通用弹窗全局样式】遮罩、弹窗、文本、图片、关闭按钮、双主题兼容
   ============================================ */

/* 遮罩层 */
.global-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
}
/* //【修复底部按钮点击拦截】!important 防御 HTML 内联 style="display:none" 覆盖 */
.global-modal-overlay.show {
  display: flex !important;
}

/* 弹窗容器 */
.global-modal {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.25s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 关闭按钮 */
.global-modal-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.global-modal-close:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

/* 弹窗正文区域 */
.global-modal-body {
  padding: 28px 24px;
  overflow-y: auto;
  max-height: 70vh;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
}

/* 声明标题 */
.global-modal-body .decl-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* 社群二维码弹窗内图片 */
.global-modal-body .qrcode-img-wrap {
  text-align: center;
  padding: 8px 0;
}
.global-modal-body .qrcode-img-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 空状态提示（社群未上传） */
.global-modal-body .qrcode-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* 暗色主题弹窗适配 */
[data-theme="dark"] .global-modal-overlay {
  background: rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] .global-modal-body .qrcode-img-wrap img {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
