/* ===== 用户前台样式 ===== */
:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --red: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text); font-size: 15px; background: #fff; line-height: 1.65;
  display: flex; flex-direction: column; min-height: 100vh;
}
.page-main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* 导航 */
.navbar {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.navbar .inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.navbar .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text);
}
.navbar .brand img { height: 32px; width: auto; display: block; }
.navbar .brand span { color: var(--primary); }
.navbar .brand-text { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.navbar nav a { color: var(--muted); }
.navbar nav a:hover { color: var(--primary); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 22px; font-size: 15px;
  cursor: pointer; transition: all .15s; font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 13px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 首页 */
.hero { background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); padding: 56px 0 44px; text-align: center; }
.hero h1 { font-size: 30px; margin-bottom: 10px; }
.hero p { color: var(--muted); margin-bottom: 26px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 34px 0 60px; }
.app-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 22px;
  transition: all .15s; background: #fff;
}
.app-card:hover { border-color: var(--primary); box-shadow: 0 10px 28px rgba(245,158,11,.18); transform: translateY(-2px); }
.app-card .icon {
  width: 46px; height: 46px; border-radius: 12px; background: #dbeafe; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; margin-bottom: 12px;
}
.app-card h3 { font-size: 16px; margin-bottom: 6px; }
.app-card p { color: var(--muted); font-size: 13px; min-height: 40px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; margin-top: 8px; }
.tag-free { background: #dcfce7; color: #15803d; }
.tag-paid { background: #dbeafe; color: #1d4ed8; }
.tag-group { background: #f1f5f9; color: #475569; }

/* 首页搜索 + 分组导航 */
.search-hero { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.search-hero input {
  flex: 1; padding: 12px 18px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; outline: none; background: #fff;
}
.search-hero input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.search-hero button {
  padding: 12px 28px; border: none; border-radius: 999px; background: var(--primary);
  color: #fff; font-size: 14px; cursor: pointer;
}
.search-hero button:hover { background: var(--primary-dark); }
.group-nav { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 30px; }
.group-item {
  padding: 7px 18px; border-radius: 999px; font-size: 13px; color: var(--muted);
  background: #f1f5f9; transition: all .15s;
}
.group-item:hover { color: var(--primary); background: #e0e9ff; }
.group-item.active { background: var(--primary); color: #fff; }
.search-meta { padding-top: 18px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.search-meta a { color: var(--primary); }
.empty-tip { grid-column: 1/-1; text-align: center; padding: 50px 0; color: var(--muted); }
.app-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.app-card-tags .tag { margin-top: 10px; }

/* 产品页 */
.product-hero { background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); padding: 48px 0 36px; }
.product-hero .p-head { display: flex; gap: 20px; align-items: center; }
.product-hero .icon {
  width: 72px; height: 72px; border-radius: 18px; background: #dbeafe; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; flex: none;
}
.product-hero h1 { font-size: 26px; }
.product-hero .desc { color: var(--muted); margin: 6px 0 14px; }
.product-hero .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.member-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 12px; padding: 14px 20px; margin: 18px 0;
}
.member-bar.off { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* 套餐卡片 */
.plans-tip { margin: 20px 0 -8px; font-size: 15px; font-weight: 600; color: var(--text); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 22px 0; }
.plan-card { border: 1.5px solid var(--border); border-radius: 14px; padding: 22px 18px; text-align: center; position: relative; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.plan-card.selected { border-color: var(--primary); background: #fff7ed; box-shadow: 0 0 0 2.5px rgba(245, 158, 11, .28); transform: translateY(-2px); }
.plan-card.hot { border-color: var(--primary); }
.plan-card .hot-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; padding: 2px 12px; border-radius: 999px;
}
.plan-card .name { color: var(--muted); font-size: 14px; }
.plan-card .price { font-size: 30px; font-weight: 700; margin: 8px 0 2px; }
.plan-card .price small { font-size: 14px; font-weight: 400; }
.plan-card .days { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.plan-card .remark { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* 版本记录 */
.versions { margin: 14px 0 50px; }
.version-item { border-left: 2px solid var(--border); padding: 0 0 22px 20px; position: relative; }
.version-item::before {
  content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary);
}
.version-item .v { font-weight: 600; }
.version-item .d { color: #9ca3af; font-size: 12px; margin-left: 10px; }
.version-item ul { margin: 8px 0 0 20px; color: var(--muted); font-size: 13px; }

/* 认证卡片 */
.auth-wrap { display: flex; justify-content: center; padding: 56px 20px 70px; background: #f8fafc; min-height: calc(100vh - 60px); }
.auth-card {
  width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 34px 32px;
}
.auth-card h2 { text-align: center; margin-bottom: 4px; }
.auth-card .appname { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.auth-card input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; transition: border .15s;
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; padding: 10px 14px; font-size: 13px; }
.auth-card .foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }
.msg-ok { background: #dcfce7; color: #166534; }
.msg-err { background: #fee2e2; color: #991b1b; }

/* 支付页 */
.pay-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 34px; padding: 40px 0 60px; align-items: start; }
@media (max-width: 760px) { .pay-wrap { grid-template-columns: 1fr; } }
.qr-box { text-align: center; }
.qr-box .frame {
  width: 230px; height: 230px; margin: 0 auto 14px; border: 1.5px dashed var(--border);
  border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafafa;
}
.qr-box .frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-box .frame .empty { color: #c0c6cf; font-size: 13px; padding: 20px; }
.pay-info .row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pay-info .row .k { color: var(--muted); }
.pay-amount { font-size: 34px; font-weight: 700; color: var(--red); margin: 18px 0; }
.pay-amount small { font-size: 15px; }
.pay-status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; }
.st-unpaid { background: #fef3c7; color: #b45309; }
.st-confirming { background: #dbeafe; color: #1d4ed8; }
.st-paid { background: #dcfce7; color: #15803d; }
.st-refunded { background: #fee2e2; color: #b91c1c; }
.st-closed { background: #f1f5f9; color: #64748b; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 14px; }

/* 支付等待动画 */
.pay-waiting { background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; border-radius: 10px; padding: 12px 16px; font-size: 14px; text-align: center; }
.pay-waiting .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; margin-right: 6px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.btn-sm { font-size: 13px; padding: 7px 14px; border-radius: 8px; }

/* 用户中心 */
.me-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; padding: 30px 0 60px; }
@media (max-width: 760px) { .me-grid { grid-template-columns: 1fr; } }
.me-card { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-radius: 16px; padding: 26px; }
.me-card .lb { opacity: .8; font-size: 13px; }
.me-card .vl { font-size: 20px; font-weight: 700; margin: 4px 0 18px; }
.me-card .btn { background: rgba(255,255,255,.16); color: #fff; }
.me-card .btn:hover { background: rgba(255,255,255,.28); }

/* 产品 Logo（图标框内放图：透明底居中，白底圆角） */
.app-card .icon, .product-hero .icon { overflow: hidden; }
.app-card .icon img, .product-hero .icon img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: #fff; border-radius: inherit;
}

/* 用户中心会员卡片 */
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin: 6px 0 10px;
}
.member-tile {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 16px 14px; background: #fff;
}
.member-tile.active { border-color: #bbf7d0; background: #fbfef9; box-shadow: 0 8px 22px rgba(22,163,74,.07); }
.member-tile .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.member-tile .head img, .member-tile .head .letter {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  object-fit: contain; background: #fff; border: 1px solid var(--border);
}
.member-tile .head .letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: #dbeafe; border-color: transparent; color: var(--primary);
  font-weight: 700; font-size: 17px;
}
.member-tile .t-name { min-width: 0; }
.member-tile .nm { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-tile .g { color: var(--muted); font-size: 12px; }
.member-tile .sp { flex: 1; }
.member-tile .lb { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.b-green { background: #dcfce7; color: #15803d; }
.b-gray { background: #f1f5f9; color: #64748b; }

/* “浏览其他产品”迷你卡片 */
.app-grid-mini {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin: 6px 0 8px;
}
.app-mini {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; background: #fff; transition: all .15s;
}
.app-mini:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(245,158,11,.14); }
.app-mini img, .app-mini .letter {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  object-fit: contain; background: #fff; border: 1px solid var(--border);
}
.app-mini .letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: #dbeafe; border-color: transparent; color: var(--primary);
  font-weight: 700; font-size: 15px;
}
.app-mini .nm { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-mini .meta { color: var(--muted); font-size: 12px; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; }

/* 分页条（与后台 /admin 的分页保持同一交互） */
.pager {
  display: flex; gap: 8px; justify-content: space-between; align-items: center;
  flex-wrap: wrap; margin-top: 14px; color: var(--muted);
}
.pager-info { font-size: 13px; }
.pager-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 页面标题 */
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); font-size: 14px; }

/* 客服悬浮按钮（全站统一组件）：悬浮按钮自动弹出二维码，移开自动关闭 */
.service-box { position: fixed; right: 22px; bottom: 26px; z-index: 100; }
.service-fab {
  background: var(--primary); color: #fff; border-radius: 999px; padding: 12px 18px;
  display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 8px 24px rgba(37,99,235,.35);
  font-size: 14px; border: none; font-family: inherit;
}
.service-fab:hover { background: var(--primary-dark); }
.service-fab svg { width: 17px; height: 17px; }
.service-pop {
  position: absolute; right: 0; bottom: calc(100% + 10px); width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  text-align: center; box-shadow: 0 18px 44px rgba(0,0,0,.14); display: none;
}
/* 悬浮在按钮或二维码上时显示（触屏点按走 .show） */
.service-box:hover .service-pop, .service-pop.show { display: block; }
/* 透明桥接块：填补按钮与弹窗之间的缝隙，鼠标移过去不闪断 */
.service-pop::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; }
.service-pop .qr { width: 170px; height: 170px; margin: 10px auto; border: 1px dashed var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.service-pop .qr img { width: 100%; height: 100%; object-fit: contain; }
.service-pop .qr .empty { color: #c0c6cf; font-size: 12px; padding: 14px; }
.service-pop h4 { font-size: 14px; }

/* 错误页 */
.error-wrap { text-align: center; padding: 110px 20px; }
.error-wrap h1 { font-size: 22px; margin: 18px 0 8px; }
.error-wrap p { color: var(--muted); }

/* 频道选择 */
.channel-pick { display: flex; gap: 12px; margin: 8px 0 4px; }
.channel-pick label {
  flex: 1; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px;
}
.channel-pick input { accent-color: var(--primary); }
.channel-pick label.on { border-color: var(--primary); background: #fff7ed; }
.channel-pick .pay-logo { flex: 0 0 auto; border-radius: 4px; display: block; }

/* 底部 */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  background: #fafafa;
}
.site-footer p { margin: 0; }
.site-footer .icp a { color: var(--muted); }
.site-footer .icp a:hover { color: var(--primary); }

/* ========== 滑块验证码 Modal ========== */
.captcha-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.captcha-modal[hidden] { display: none; }
.captcha-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  animation: captcha-fade .2s ease;
}
.captcha-dialog {
  position: relative; z-index: 1;
  width: 360px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .22);
  overflow: hidden;
  animation: captcha-pop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes captcha-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes captcha-pop {
  from { transform: translateY(12px) scale(.96); opacity: 0 }
  to   { transform: translateY(0)    scale(1);    opacity: 1 }
}
.captcha-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff7ed, #fff);
}
.captcha-title { font-size: 15px; font-weight: 600; color: #1f2937; }
.captcha-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 24px; line-height: 1; color: #94a3b8;
  width: 28px; height: 28px; border-radius: 6px;
}
.captcha-close:hover { background: #f1f5f9; color: #475569; }

.captcha-stage {
  position: relative; margin: 16px auto 0; width: 320px; height: 180px;
  border-radius: 8px; overflow: hidden; background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--border);
}
.captcha-bg { display: block; width: 320px; height: 180px; user-select: none; -webkit-user-drag: none; }
.captcha-piece {
  position: absolute; top: 20px; left: 0; cursor: default;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  transition: filter .15s;
  animation: piece-pop .25s ease;
}
.captcha-piece img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.captcha-piece.shake { animation: piece-shake .35s ease; }
@keyframes piece-pop {
  from { transform: translateY(-6px); opacity: 0 }
  to   { transform: translateY(0);    opacity: 1 }
}
@keyframes piece-shake {
  0%, 100% { transform: translateX(0) }
  20%      { transform: translateX(-6px) }
  40%      { transform: translateX(6px) }
  60%      { transform: translateX(-4px) }
  80%      { transform: translateX(4px) }
}

.captcha-refresh {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.85);
  color: #475569; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.captcha-refresh:hover { background: #fff; color: var(--primary); }
.captcha-refresh:disabled { opacity: .5; cursor: not-allowed; }

.captcha-track {
  position: relative; margin: 14px 20px 0; height: 40px;
  background: #f1f5f9; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.captcha-track-bg {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 70%, #fef3c7 100%);
  border-radius: inherit;
}
.captcha-slider {
  position: absolute; top: 0; left: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  cursor: grab; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .25);
  user-select: none; touch-action: none; outline: none;
  transition: box-shadow .15s, transform .1s;
}
.captcha-slider:hover { box-shadow: 0 4px 12px rgba(245, 158, 11, .35); }
.captcha-slider:focus { box-shadow: 0 0 0 3px rgba(245,158,11,.3); }
.captcha-slider.dragging { cursor: grabbing; background: #fff7ed; }
.captcha-slider.loading { animation: slider-loading 1s linear infinite; }
@keyframes slider-loading {
  to { transform: rotate(360deg); }
}

.captcha-tip {
  position: relative; z-index: 1; pointer-events: none;
  color: #94a3b8; font-size: 13px; letter-spacing: .5px;
}
.captcha-foot {
  padding: 10px 20px 18px; min-height: 24px;
}
.captcha-status { font-size: 12px; }
.captcha-status.ok  { color: #16a34a; }
.captcha-status.err { color: #dc2626; }

@media (max-width: 420px) {
  .captcha-dialog { width: 100%; border-radius: 14px 14px 0 0; }
  .captcha-stage { width: calc(100vw - 40px); height: calc((100vw - 40px) * 0.5625); }
  .captcha-bg    { width: 100%; height: 100%; }
}
