/* =========================================================
   前台样式 — 完全重写，移动端优先
   基于 layui 2.9.x，针对各种屏幕尺寸优化
   ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f4f5f7;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 通用容器：自适应内边距 */
.layui-container {
  width: 100%;
  max-width: 1140px;
  padding-left: 16px;
  padding-right: 16px;
}

/* 区块外边距包装类（替代内联 style） */
.hero-wrap { padding-top: 20px; }
.stat-wrap { margin-top: 16px; }
.info-wrap { padding-bottom: 8px; }
@media (max-width: 575px){
  .hero-wrap { padding-top: 14px; }
  .stat-wrap { margin-top: 12px; }
}

/* ===== 顶部导航 ===== */
.site-nav {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 8px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f1f1f;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-actions .layui-btn {
  margin: 0;
  padding: 0 12px;
  height: 32px;
  line-height: 32px;
  font-size: 13px;
}

/* ===== Hero 卡片 ===== */
.hero-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eee;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.hero-body {
  text-align: center;
  padding: 36px 20px;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(30, 159, 255, 0.18);
}

.hero-name {
  font-size: 24px;
  font-weight: 600;
  margin-top: 14px;
  color: #1f1f1f;
}

.hero-version {
  margin: 8px 0 14px;
}

.hero-intro {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  max-width: 580px;
  margin: 12px auto 0;
  text-align: left;
  padding: 0 4px;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-actions .layui-btn {
  margin: 0;
}

/* ===== 统计卡 ===== */
.stat-card {
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  transition: transform 0.18s, box-shadow 0.18s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.stat-body {
  text-align: center;
  padding: 18px 8px;
}

.stat-n {
  font-size: 22px;
  font-weight: 700;
  color: #1E9FFF;
  line-height: 1.2;
  word-break: break-all;
}

.stat-l {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-l .layui-icon {
  font-size: 13px;
}

/* ===== 通用卡片 ===== */
.info-card {
  border-radius: 12px;
  border: 1px solid #eee;
  overflow: hidden;
  margin-top: 14px;
  background: #fff;
}

.info-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fafafa;
}

.info-card-body {
  padding: 0;
}

/* 详情表格 */
.detail-row {
  display: flex;
  padding: 12px 18px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row .dr-k {
  color: #888;
  width: 90px;
  flex-shrink: 0;
}

.detail-row .dr-v {
  color: #333;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.detail-row .dr-v.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* 社区链接 */
.community-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  text-decoration: none;
  transition: background 0.18s;
  gap: 12px;
}

.community-link:last-child {
  border-bottom: 0;
}

.community-link:hover,
.community-link:active {
  background: #f8f9fa;
}

.community-link .cl-info {
  flex: 1;
  min-width: 0;
}

.community-link .cl-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1f1f1f;
}

.community-link .cl-desc {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  margin-left: 24px;
}

.community-link .layui-icon-right {
  color: #ccc;
  font-size: 14px;
  flex-shrink: 0;
}

/* 页脚 */
.site-footer {
  text-align: center;
  padding: 24px 0 36px;
  color: #999;
  font-size: 12px;
}

/* ===== 弹窗内容容器 ===== */
.frontend-modal {
  box-sizing: border-box;
  padding: 20px;
}

.frontend-modal .layui-form-label {
  width: auto !important;
  float: none !important;
  display: block;
  padding: 0 0 6px 0 !important;
  text-align: left !important;
  font-weight: 500;
}

.frontend-modal .layui-input-block {
  margin-left: 0 !important;
}

.frontend-modal .modal-tip {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #fff8e6;
  border-left: 3px solid #FFB800;
  border-radius: 4px;
}

.frontend-modal .modal-actions {
  text-align: right;
  padding-top: 12px;
  border-top: 1px solid #eee;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.frontend-modal .modal-actions .layui-btn {
  margin: 0;
}

.frontend-modal .info-box {
  font-size: 13px;
  color: #666;
  padding: 10px 12px;
  background: #f8f8f8;
  border-radius: 6px;
  margin-bottom: 12px;
  line-height: 1.7;
}

/* layer 弹窗微调（让圆角更柔和） */
.layui-layer-page .layui-layer-content {
  overflow: auto !important;
}

/* ===== 响应式：平板 ===== */
@media (max-width: 768px) {
  .hero-body { padding: 28px 16px; }
  .hero-name { font-size: 22px; }
  .hero-intro { font-size: 13px; }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 575px) {
  .layui-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .site-nav-inner {
    padding: 10px 0;
  }

  .nav-brand {
    font-size: 15px;
    gap: 8px;
  }

  .nav-brand img {
    width: 28px;
    height: 28px;
  }

  .nav-actions .layui-btn {
    padding: 0 10px;
    height: 30px;
    line-height: 30px;
    font-size: 12px;
  }

  .nav-actions .layui-btn .layui-icon {
    font-size: 13px;
  }

  .hero-body { padding: 24px 14px; }
  .hero-icon { width: 80px; height: 80px; border-radius: 18px; }
  .hero-name { font-size: 20px; }
  .hero-intro { font-size: 13px; padding: 0; }

  .hero-actions { gap: 8px; }
  .hero-actions .layui-btn-lg {
    padding: 0 18px;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
  }

  .stat-body { padding: 14px 4px; }
  .stat-n { font-size: 18px; }
  .stat-l { font-size: 11px; }

  .info-card-header { padding: 12px 14px; font-size: 13px; }
  .detail-row { padding: 10px 14px; font-size: 13px; }
  .detail-row .dr-k { width: 70px; font-size: 13px; }

  .community-link { padding: 12px 14px; }

  .frontend-modal { padding: 16px; }
}

/* ===== 极窄设备 ===== */
@media (max-width: 360px) {
  .nav-brand span { font-size: 14px; }
  .nav-actions .layui-btn span,
  .nav-actions .layui-btn { font-size: 12px; }
  .stat-n { font-size: 16px; }
}

/* =========================================================
   自带 Modal 系统 — 不依赖 layui
   ========================================================= */
.sm-locked { overflow: hidden !important; height: 100vh; }

.sm-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}
.sm-mask.sm-show { opacity: 1; }

.sm-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  margin: auto;
}
.sm-box.sm-show { transform: scale(1); opacity: 1; }
.sm-box.sm-box-large { max-width: 640px; }

.sm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f3;
  flex-shrink: 0;
  background: #fafbfc;
}
.sm-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-title .sm-icon { margin-right: 4px; }
.sm-close {
  color: #999;
  font-size: 26px;
  line-height: 1;
  width: 32px;
  height: 32px;
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sm-close:hover, .sm-close:active { background: #f0f2f5; color: #333; }

.sm-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.sm-body > .frontend-modal { padding: 18px; }

.sm-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sm-btn {
  border: 1px solid #d2d6dc;
  background: #fff;
  color: #444;
  padding: 0 18px;
  height: 36px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.sm-btn:hover { background: #f7f8fa; border-color: #b8bcc4; }
.sm-btn-primary {
  background: #1E9FFF;
  border-color: #1E9FFF;
  color: #fff;
}
.sm-btn-primary:hover { background: #0D8DEE; border-color: #0D8DEE; }
.sm-btn-danger {
  background: #FF5722;
  border-color: #FF5722;
  color: #fff;
}
.sm-btn-danger:hover { background: #E64A19; border-color: #E64A19; }

/* Toast */
.sm-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
}
.sm-toast.sm-toast-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.sm-toast-warn { background: rgba(255, 152, 0, 0.95); }
.sm-toast-error { background: rgba(244, 67, 54, 0.95); }
.sm-toast-success { background: rgba(76, 175, 80, 0.95); }

/* Modal 内的表单样式（沿用 layui 但调整） */
.sm-body .layui-form-item { margin-bottom: 14px; }
.sm-body .layui-form-label {
  float: none !important;
  width: auto !important;
  padding: 0 0 6px 0 !important;
  text-align: left !important;
  display: block !important;
  font-weight: 500;
}
.sm-body .layui-input-block { margin-left: 0 !important; }
.sm-body .modal-actions { margin-top: 14px; }

/* 手机：modal 占满更多屏幕 */
@media (max-width: 575px) {
  .sm-mask { padding: 12px; align-items: flex-end; }
  .sm-box {
    max-width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 12px 12px 0 0;
  }
  .sm-mask.sm-show .sm-box {
    border-radius: 12px 12px 0 0;
  }
  .sm-head { padding: 12px 14px; }
  .sm-title { font-size: 14px; }
  .sm-body > .frontend-modal { padding: 14px; }
  .sm-footer { padding: 10px 12px; }
  .sm-btn { height: 38px; padding: 0 14px; font-size: 13px; flex: 1; min-width: 80px; }
}

/* =========================================================
   iOS 引流弹窗样式
   ========================================================= */
.ios-promo-status {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #e74c3c;
  padding: 4px 0 14px;
}

.ios-promo-reqs {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid #eef0f3;
}

.ios-promo-req {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  padding: 4px 0;
}

.ios-promo-req + .ios-promo-req {
  border-top: 1px dashed #e8e8e8;
  margin-top: 4px;
  padding-top: 8px;
}

.ios-promo-qq {
  text-align: center;
  font-size: 15px;
  color: #333;
  padding-top: 14px;
}

.ios-promo-qq strong {
  color: #1E9FFF;
  font-size: 16px;
  letter-spacing: 0.5px;
}

@media (max-width: 575px) {
  .ios-promo-status { font-size: 15px; }
  .ios-promo-reqs { padding: 12px 14px; }
  .ios-promo-req { font-size: 13px; }
  .ios-promo-qq { font-size: 14px; }
}

/* =========================================================
   底部安全距离 — 防止浏览器工具栏遮挡内容
   ========================================================= */
body {
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.site-footer {
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
}
