/* ===== 基础重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --text: #1e293b;
  --muted: #64748b;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .05);
}
html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== 公共页顶栏 ===== */
.topbar { background: var(--dark); color: #cbd5e1; position: sticky; top: 0; z-index: 100; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: #fff; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.topbar-nav { display: flex; align-items: center; gap: 8px; }
.topbar-nav a { color: #cbd5e1; padding: 8px 14px; border-radius: 8px; font-size: 14px; }
.topbar-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar-nav a.btn-primary { background: var(--primary); color: #fff; }
.topbar-nav a.btn-primary:hover { background: var(--primary-dark); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 8px; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: #cbd5e1; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 首页 ===== */
.hero { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color: #fff; padding: 70px 20px; text-align: center; }
.hero h1 { font-size: 38px; font-weight: 800; margin-bottom: 14px; }
.hero p { font-size: 17px; color: #bfdbfe; max-width: 640px; margin: 0 auto 26px; }
.hero .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btns a { padding: 12px 28px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.hero .btns .b1 { background: var(--primary); color: #fff; }
.hero .btns .b1:hover { background: var(--primary-dark); }
.hero .btns .b2 { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.hero .btns .b2:hover { background: rgba(255,255,255,.2); }

.features { max-width: 1200px; margin: -34px auto 0; padding: 0 20px; position: relative; z-index: 5; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature-card .ic { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 20px; font-weight: 700; color: #fff; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 13px; }

.section { max-width: 1200px; margin: 0 auto; padding: 48px 20px; }
.section-title { text-align: center; font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 30px; }

.soft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.soft-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; }
.soft-head { padding: 18px 20px; background: linear-gradient(135deg, var(--dark-2), #1e3a8a); color: #fff; }
.soft-head h3 { font-size: 18px; }
.soft-head .ver { color: #93c5fd; font-size: 13px; margin-top: 2px; }
.soft-body { padding: 16px 20px; flex: 1; }
.soft-body p { color: var(--muted); font-size: 13px; margin-bottom: 14px; min-height: 40px; }
.tpl-list { list-style: none; }
.tpl-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.tpl-list li:last-child { border-bottom: none; }
.tpl-list li > span:first-child { flex: 1; min-width: 0; }
.tpl-price { color: var(--red); font-weight: 700; white-space: nowrap; }
.tpl-price small { font-weight: 400; color: var(--muted); font-size: 12px; }
.tpl-buy { white-space: nowrap; }

.site-footer { background: var(--dark); color: #94a3b8; text-align: center; padding: 26px 20px; font-size: 13px; margin-top: 40px; }

/* ===== 认证页 ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); padding: 20px; }
.auth-box { background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); width: 100%; max-width: 420px; padding: 34px 34px 26px; }
.auth-box h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-foot a { margin: 0 6px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group label .req { color: var(--red); }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.btn { display: inline-block; padding: 9px 18px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: background .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #059669; color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #dc2626; color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #d97706; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #eff6ff; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ===== 提示消息 ===== */
.flash { max-width: 1200px; margin: 14px auto 0; padding: 0 20px; }
.alert { padding: 11px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== 控制台布局 ===== */
.dash { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--dark); color: #cbd5e1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 50; }
.sidebar .brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar .panel-tag { padding: 12px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; }
.sidebar nav { padding: 8px 12px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: #cbd5e1; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px; font-size: 14px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav a svg { flex-shrink: 0; opacity: .85; }
.sidebar .side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #64748b; }

.dash-main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-height: 100vh; }
.dash-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 24px; height: 62px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40; }
.dash-topbar h2 { font-size: 17px; }
.dash-topbar .user-box { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.dash-topbar .user-box b { color: var(--text); }
.sidebar-toggle { display: none; background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; }
.sidebar-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; }
.dash-content { padding: 24px; flex: 1; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.blue { color: var(--primary); }
.stat-card .value.orange { color: var(--orange); }
.stat-card .value.red { color: var(--red); }

/* ===== 面板卡片 ===== */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 20px; }
.card-body.thin { padding: 0; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #f8fafc; text-align: left; padding: 11px 14px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafc; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 13px; }
.card-no-cell { font-family: "SFMono-Regular", Consolas, monospace; color: var(--primary-dark); font-weight: 600; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-gray { background: #e2e8f0; color: #475569; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 20px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); font-size: 13px; color: var(--text); background: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 过滤器 ===== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .form-control { width: auto; min-width: 120px; }
.filters .grow { flex: 1; min-width: 160px; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ic { font-size: 40px; margin-bottom: 10px; }

/* ===== 模态框 ===== */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.modal .form-group { margin-bottom: 14px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ===== 生成结果卡片 ===== */
.gen-result { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 16px; max-height: 380px; overflow-y: auto; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.9; white-space: pre-wrap; word-break: break-all; }

/* ===== 明细列表 ===== */
.info-list { list-style: none; }
.info-list li { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.info-list li:last-child { border-bottom: none; }
.info-list .k { width: 130px; color: var(--muted); flex-shrink: 0; }
.info-list .v { flex: 1; word-break: break-all; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .brand span, .sidebar .panel-tag, .sidebar nav a span, .sidebar .side-foot { display: none; }
  .sidebar nav a { justify-content: center; }
  .dash-main { margin-left: 60px; }
  .form-row { flex-direction: column; gap: 0; }
  .hero { padding: 50px 16px; }
  .hero h1 { font-size: 30px; }
}

@media (max-width: 640px) {
  /* 公共页顶部导航折叠 */
  .nav-toggle { display: flex; }
  .topbar-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--dark); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 14px 14px; border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 12px 24px rgba(0,0,0,.3); }
  .topbar-nav.open { display: flex; }
  .topbar-nav a { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .topbar-nav a:last-child { border-bottom: none; }
  .topbar-nav a.btn-primary { background: transparent; color: #fff; }

  /* 控制台侧栏抽屉：恢复完整宽度（覆盖 900px 断点的 60px 收缩） */
  .sidebar-toggle { display: flex; }
  .sidebar { width: 230px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 30px rgba(0,0,0,.35); overflow-x: hidden; }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand span, .sidebar .panel-tag, .sidebar nav a span, .sidebar .side-foot { display: block; }
  .sidebar nav a { justify-content: flex-start; }
  .dash-main { margin-left: 0; }

  /* 抽屉遮罩：点击外部关闭 */
  .dash-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 45; }
  .dash-overlay.show { display: block; }
  .dash-topbar { padding: 0 14px; height: 56px; }
  .dash-topbar .user-box { gap: 8px; }
  .dash-topbar .user-box span { display: none; }
  .dash-content { padding: 14px; }

  /* 统计卡片 2 列 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 22px; }

  /* 卡片内边距压缩 */
  .card-head, .card-body { padding: 14px; }
  .card-body.thin { padding: 0; }

  /* 表单与按钮全宽友好 */
  .filters .form-control, .filters .grow { width: 100%; min-width: 0; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .btn { text-align: center; }
  .form-row { flex-direction: column; gap: 0; }

  /* 认证页 */
  .auth-box { padding: 26px 22px 20px; }
  .auth-box h1 { font-size: 19px; }

  /* 首页软件卡片 */
  .soft-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 14px; }
  .features { padding: 0 14px; }

  /* 模态框 */
  .modal { padding: 20px; }

  /* 表格横向滚动提示 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 9px 10px; }
}

@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ===== 订单与支付 ===== */
.order-item { padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; background: #f8fafc; }
.order-name { font-size: 17px; font-weight: 700; }
.order-tpl { color: var(--primary); font-weight: 600; margin: 4px 0 8px; }
.order-desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.order-price { color: var(--red); font-size: 22px; font-weight: 800; }

.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-method { cursor: pointer; }
.pay-method input { display: none; }
.pay-method-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 2px solid var(--border); border-radius: 10px; transition: border-color .15s, background .15s; }
.pay-method input:checked + .pay-method-box { border-color: var(--primary); background: rgba(37, 99, 235, .05); }
.pay-method-name { font-size: 13px; color: var(--text); }
.pay-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700; }
.pay-alipay { background: linear-gradient(135deg, #1677ff, #0e5ac8); }
.pay-wxpay { background: linear-gradient(135deg, #07c160, #05a24e); }
.pay-qqpay { background: linear-gradient(135deg, #12b7f5, #0b8fd6); }

.pay-box { text-align: center; padding: 26px 10px; }
.pay-ok .ic { font-size: 56px; margin-bottom: 12px; }
.pay-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }

.card-gift { background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.9; }

.center-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pay-result { text-align: center; }
.pay-result-icon { font-size: 56px; margin-bottom: 12px; }
.pay-ok { color: var(--green); }
.pay-wait { color: var(--orange, #f59e0b); }
.pay-fail { color: var(--red); }
.pay-result h2 { font-size: 21px; margin-bottom: 10px; }
.pay-result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ===== 补充类（页面引用但缺失） ===== */
.muted { color: var(--muted); }
.text-clamp { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 10px; }
.steps-box { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 8px 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.step.active { color: var(--primary); border-color: var(--primary); background: #eff6ff; font-weight: 600; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step.active .step-num { background: var(--primary); color: #fff; }
.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: #d1fae5; color: #059669; font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.auth-info { list-style: none; }
.auth-info li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.auth-info li:last-child { border-bottom: none; }
.auth-info .k { color: var(--muted); flex-shrink: 0; }
.auth-info .v { font-weight: 600; word-break: break-all; text-align: right; }

/* 触控目标：表格行内小按钮在移动端加大点击区 */
@media (max-width: 640px) {
  .btn-sm { padding: 9px 14px; font-size: 14px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .table .ops { gap: 6px; }
  .table .ops .btn-sm { margin: 2px 0; }
  .form-control { font-size: 16px; }
  textarea.form-control { font-size: 16px; }
}

/* 多列宽表：移动端隐藏低频列，减少横向滚动距离 */
@media (max-width: 640px) {
  table.table .hide-mobile { display: none; }
  .text-clamp { max-width: 140px; }
}

/* 极窄屏：明细列表标签列收窄 */
@media (max-width: 380px) {
  .info-list .k { width: 100px; }
}
