/* PGD 用户控制台 — 参考专业加密站浅色侧栏风格 */
:root {
  --side: #f7f8fa;
  --side-w: 230px;
  --side-border: #e8eaed;
  --main-bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #8c8c8c;
  --line: #eef0f3;
  --primary: #1890ff;
  --primary-d: #096dd9;
  --ok: #52c41a;
  --bad: #ff4d4f;
  --warn: #fa8c16;
  --active-bg: #e6f7ff;
  --active-border: #1890ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--main-bg);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

/* ===== Guest landing ===== */
.guest-top {
  background: #fff;
  border-bottom: 1px solid var(--side-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.guest-top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.guest-top .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guest-top .brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #1890ff, #36cfc9);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.guest-top .spacer { flex: 1; }
.guest-top a.navlink {
  color: #595959; padding: 6px 10px; border-radius: 6px; text-decoration: none;
}
.guest-top a.navlink:hover { background: #f5f5f5; color: var(--primary); }

.landing { padding: 48px 20px 64px; }
.landing-inner { max-width: 1100px; margin: 0 auto; }
.landing h1 {
  margin: 0 0 12px; font-size: 32px; font-weight: 700; color: #141414; letter-spacing: -.02em;
}
.landing .lead { margin: 0 0 24px; color: #8c8c8c; font-size: 15px; line-height: 1.8; max-width: 640px; }
.landing-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.feature .tag {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px;
  margin-bottom: 10px; font-weight: 600;
}
.feature h3 { margin: 0 0 8px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }
.landing-note { margin-top: 24px; color: #8c8c8c; font-size: 12px; line-height: 1.7; max-width: 720px; }

/* ===== Auth：整页固定高度，禁止出现右侧滚动条 ===== */
html.auth-body,
html.auth-body body.auth-body {
  height: 100% !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
}
body.auth-body {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}
body.auth-body .guest-top {
  flex-shrink: 0;
  position: relative;
  top: auto;
}
body.auth-body .auth-page {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden !important;
  background: linear-gradient(180deg, #f5f7fa 0%, #eef2f7 100%);
  box-sizing: border-box;
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff;
  border-radius: 10px; padding: 28px 28px 22px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  max-height: 100%;
  overflow: hidden;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.auth-card .links { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ===== App shell ===== */
.app-shell { display: flex; height: 100vh; max-height: 100vh; overflow: hidden; background: var(--main-bg); }
body:has(.app-shell) {
  overflow: hidden !important;
  height: 100vh;
  max-height: 100vh;
}

.app-side {
  width: var(--side-w);
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--side-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.app-side .logo {
  padding: 16px 14px;
  border-bottom: 1px solid var(--side-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}
.app-side .logo .mark {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #1890ff, #36cfc9);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.app-side .logo strong {
  font-size: 13px; color: #262626; line-height: 1.35; font-weight: 700;
}
.app-menu {
  flex: 1; overflow-y: auto; padding: 10px 8px 16px;
}
.app-menu .group {
  margin: 14px 10px 6px;
  font-size: 12px; color: #bfbfbf; font-weight: 500;
}
.app-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin: 1px 0; border-radius: 6px;
  color: #595959; text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
}
.app-menu a:hover { background: #fff; color: var(--primary); }
.app-menu a.active {
  background: var(--active-bg);
  color: var(--primary);
  border-left-color: var(--active-border);
  font-weight: 600;
}
.app-menu a .ico { width: 18px; text-align: center; opacity: .85; flex-shrink: 0; }
.app-menu a .label { flex: 1; min-width: 0; }
.badge {
  display: inline-block; font-size: 11px; line-height: 18px; padding: 0 6px;
  border-radius: 3px; font-weight: 600; flex-shrink: 0;
}
.badge.free { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge.std { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.badge.pro { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.app-top {
  height: 48px; background: #fff; border-bottom: 1px solid var(--side-border);
  display: flex; align-items: center; padding: 0 20px; gap: 10px; flex-shrink: 0;
}
.app-top .top-brand { font-size: 14px; font-weight: 600; color: #262626; }
.app-top .top-title { font-size: 15px; font-weight: 600; color: #262626; }
.app-top .crumb { color: #8c8c8c; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.app-top .crumb b { color: #262626; font-weight: 600; }
.app-top .spacer { flex: 1; }
.app-top .userbox {
  display: flex; align-items: center; gap: 8px; color: #595959; font-size: 13px;
}
.app-top .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #69c0ff, #1890ff);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.app-top .avatar .avatar-fb {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.app-top .avatar .avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
  background: #fff;
}
.app-top .top-exit { color: #8c8c8c; margin-left: 6px; font-size: 12px; }
.app-top .top-exit:hover { color: var(--primary); }

/* page-tabs 已移除，保留空规则避免旧缓存报错 */
.page-tabs,.page-tab{display:none!important}

.app-content {
  padding: 16px 18px 28px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-content::-webkit-scrollbar { width: 0; height: 0; display: none; }
.app-footer { flex-shrink: 0; }
.app-footer {
  padding: 10px 18px 14px; color: #bfbfbf; font-size: 12px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* cards */
.card {
  background: var(--card); border-radius: 8px; border: 1px solid var(--line);
  padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.card + .card { margin-top: 14px; }
.card-title {
  margin: 0 0 14px; font-size: 15px; font-weight: 600; color: #262626;
  display: flex; align-items: center; gap: 8px;
}
.notice-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #fafafa; border-radius: 6px; font-size: 13px;
}
.notice-row .nt { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }

.info-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .info-grid, .stat-grid { grid-template-columns: 1fr; }
}
.info-item, .stat-item {
  background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.info-item .k, .stat-item .k { color: #8c8c8c; font-size: 12px; margin-bottom: 6px; }
.info-item .v, .stat-item .v { font-size: 18px; font-weight: 700; color: #262626; word-break: break-all; }
.stat-item .v.money { color: #fa541c; }
.stat-item .v.ok { color: #52c41a; }
.stat-item .v.bad { color: #ff4d4f; }

.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; max-width: 820px; box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.panel.wide { max-width: 1100px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

label { display: block; margin: 12px 0 6px; font-size: 13px; color: #595959; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; font-size: 14px; color: var(--text); transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,.15);
}
textarea { min-height: 88px; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 120px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.captcha-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.captcha-row img {
  height: 38px; width: 120px; border-radius: 6px; cursor: pointer;
  border: 1px solid #d9d9d9; background: #0f172a;
}

.btn, button.btn, .pgd-btn {
  appearance: none; border: 1px solid transparent; background: var(--primary); color: #fff;
  font-weight: 500; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  line-height: 1.4;
}
.btn:hover, .pgd-btn.primary:hover { background: var(--primary-d); color: #fff; text-decoration: none; }
.btn.ghost, .pgd-btn.ghost {
  background: #fff; color: rgba(0,0,0,.85); border-color: #d9d9d9;
}
.btn.ghost:hover, .pgd-btn.ghost:hover { color: var(--primary); border-color: var(--primary); background: #fff; text-decoration: none; }
.btn.block { width: 100%; margin-top: 16px; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.flash {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; max-width: 820px;
}
.flash.ok { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.flash.bad { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: #8c8c8c; font-weight: 600; background: #fafafa; }
.tag {
  display: inline-block; padding: 0 8px; line-height: 20px; border-radius: 3px;
  font-size: 12px; font-weight: 500;
}
.tag.ok { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag.wait { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag.off { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }

.checkline {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: #595959;
}
.checkline input { width: auto; margin: 0; }
.price-line {
  margin-top: 12px; padding: 10px 12px; background: #fafafa; border: 1px dashed #d9d9d9;
  border-radius: 6px; font-size: 13px; color: #595959;
}
.empty { color: #bfbfbf; font-size: 13px; padding: 18px 0; text-align: center; }

/* 加密页：左说明 / 右表单 */
.encode-work {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.25fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) {
  .encode-work { grid-template-columns: 1fr; }
}
.encode-left .card + .card { margin-top: 12px; }
.encode-right .card { margin-top: 0; }
.encode-progress {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 8px;
}
.encode-progress[hidden] { display: none !important; }
.encode-progress-step { font-size: 13px; color: #389e0d; font-weight: 600; }
.encode-progress-bar {
  height: 8px; background: #e8e8e8; border-radius: 4px; overflow: hidden; margin: 10px 0 6px;
}
.encode-progress-bar > i {
  display: block; height: 100%; width: 8%; background: #52c41a; border-radius: 4px;
  transition: width .4s ease;
}
.btn:disabled { opacity: .65; cursor: wait; }
.desc-list {
  margin: 0; padding-left: 18px; color: #595959; font-size: 13px; line-height: 1.85;
}
.desc-list code {
  background: #f5f5f5; padding: 1px 5px; border-radius: 3px; font-size: 12px;
}
.ver-table tr.ready { background: #f6ffed; }
.sub-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: -4px 0 16px;
}
.sub-tab {
  padding: 8px 14px; font-size: 13px; color: #8c8c8c; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.sub-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.field { margin-bottom: 14px; }
.field-label {
  font-size: 13px; color: #595959; margin-bottom: 8px; font-weight: 500;
}
.field-tip { margin-top: 6px; font-size: 12px; color: #bfbfbf; }

/* 卡片式单选：隐藏原生小圆点，整卡点击 */
.sel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sel-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 18px;
  min-width: 72px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #262626;
  line-height: 1.4;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.sel-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.sel-card span {
  display: inline-block;
  writing-mode: horizontal-tb;
  white-space: nowrap;
}
.sel-card:hover { border-color: #69c0ff; color: var(--primary); }
.sel-card:has(input:checked) {
  border-color: var(--primary);
  background: #e6f7ff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}
.sel-card.pay {
  min-width: 120px;
  padding: 14px 22px;
}
.sel-card.pay .pay-name { font-size: 15px; }

/* 兼容旧 class，避免残留竖排 */
.radio-row, .check-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-chip, .check-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; margin: 0; border: 1px solid #d9d9d9; border-radius: 8px;
  background: #fff; font-size: 14px; color: #595959; cursor: pointer; white-space: nowrap;
  writing-mode: horizontal-tb;
}
.radio-chip input, .check-chip input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.radio-chip:has(input:checked), .check-chip:has(input:checked) {
  border-color: var(--primary); color: var(--primary); background: #e6f7ff;
}
.check-chip.off { opacity: .45; cursor: not-allowed; }

.tip-box {
  margin: 4px 0 14px; padding: 10px 12px; border-radius: 6px;
  background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d;
  font-size: 12px; line-height: 1.6;
}
.form-actions {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end;
}

/* dialogs */
.pgd-ui-layer { position: relative; z-index: 1000; }
.pgd-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .15s ease;
}
.pgd-mask.show { opacity: 1; }
.pgd-dialog {
  width: min(400px, 100%); background: #fff; border-radius: 8px;
  padding: 20px 24px 16px; box-shadow: 0 6px 16px rgba(0,0,0,.12);
  transform: translateY(6px); transition: transform .15s ease;
}
.pgd-mask.show .pgd-dialog { transform: none; }
.pgd-dialog-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.pgd-dialog-body { font-size: 14px; color: #595959; line-height: 1.65; white-space: pre-wrap; }
.pgd-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.pgd-btn { min-width: 72px; }

.pgd-toast-host {
  position: fixed; top: 16px; right: 16px; z-index: 1100;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.pgd-toast {
  min-width: 220px; max-width: 360px; background: #fff; color: #262626;
  padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.45;
  border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.12);
  opacity: 0; transform: translateY(-6px); transition: .2s ease;
}
.pgd-toast.show { opacity: 1; transform: none; }
.pgd-toast.ok { border-left: 3px solid #52c41a; }
.pgd-toast.bad { border-left: 3px solid #ff4d4f; }
.pgd-toast.info { border-left: 3px solid #1890ff; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; z-index: 90; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 10px; padding: 22px; width: min(380px, 100%);
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.modal h2 { margin: 0 0 6px; font-size: 16px; }
.modal .price { font-size: 24px; font-weight: 700; color: #fa541c; margin: 6px 0 10px; }
.modal .qr-box {
  width: 220px;
  height: 220px;
  margin: 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}
.modal .qr-box canvas,
.modal .qr-box img {
  display: block !important;
  width: 220px !important;
  height: 220px !important;
  max-width: 220px !important;
  max-height: 220px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  transform: none !important;
  object-fit: contain;
}
.dl-modal .dl-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; line-height: 1;
}
.dl-modal .dl-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dl-modal .dl-btn,
.dl-modal .dl-close {
  margin: 0 !important;
  min-width: 0 !important;
  height: 36px;
  padding: 0 16px !important;
  font-size: 14px !important;
  line-height: 34px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-side { width: 100%; height: auto; position: relative; }
  .app-menu { display: flex; flex-wrap: wrap; gap: 2px; max-height: none; }
  .app-menu .group { width: 100%; margin: 8px 6px 2px; }
  .app-content { padding: 12px; }
}
