* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #2b3445; line-height: 1.7; background: #fff; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* 导航 */
.navbar { position: sticky; top: 0; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.08); z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 22px; font-weight: 700; color: #1a56db; }
.logo span { color: #2b3445; }
nav a { margin-left: 28px; text-decoration: none; color: #4b5563; font-size: 15px; transition: color .2s; }
nav a:hover, nav a.active { color: #1a56db; }

/* Banner */
.hero { background: linear-gradient(120deg, #1a56db 0%, #3b82f6 60%, #60a5fa 100%); color: #fff; padding: 110px 0; text-align: center; }
.hero h1 { font-size: 40px; margin-bottom: 18px; }
.hero p { font-size: 17px; opacity: .92; max-width: 640px; margin: 0 auto 32px; }
.btn-primary { display: inline-block; background: #1a56db; color: #fff; border: none; padding: 12px 34px; border-radius: 6px; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .2s; }
.hero .btn-primary { background: #fff; color: #1a56db; font-weight: 600; }
.btn-primary:hover { background: #1448b8; color: #fff; }
.hero .btn-primary:hover { background: #eef4ff; color: #1a56db; }

/* 区块 */
.section { padding: 80px 0; }
.section-gray { background: #f6f8fb; }
.section-title { text-align: center; font-size: 30px; margin-bottom: 48px; position: relative; }
.section-title::after { content: ""; display: block; width: 48px; height: 3px; background: #1a56db; margin: 12px auto 0; border-radius: 2px; }

/* 卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.card { background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; padding: 28px 24px; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 8px 24px rgba(26,86,219,.10); transform: translateY(-3px); }
.card-icon { font-size: 34px; margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 10px; color: #1f2a44; }
.card p { font-size: 14px; color: #5b6577; }
.section-gray .card { border: none; }

/* 产品 */
.product-card { position: relative; }
.product-card ul { margin-top: 14px; padding-left: 18px; font-size: 14px; color: #5b6577; }
.badge { position: absolute; top: 16px; right: 16px; background: #eef4ff; color: #1a56db; font-size: 12px; padding: 3px 10px; border-radius: 20px; }

/* 下载 */
.download-list { display: flex; flex-direction: column; gap: 16px; }
.download-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; padding: 20px 26px; flex-wrap: wrap; }
.dl-info h3 { font-size: 17px; color: #1f2a44; }
.dl-info p { font-size: 13px; color: #8a93a6; margin-top: 4px; }
.btn-download { background: #1a56db; color: #fff; text-decoration: none; padding: 10px 26px; border-radius: 6px; font-size: 14px; white-space: nowrap; transition: background .2s; }
.btn-download:hover { background: #1448b8; }

/* 联系我们 */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info p { margin-bottom: 14px; font-size: 15px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form input, .contact-form textarea { border: 1px solid #d8dee9; border-radius: 6px; padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: #1a56db; }
.form-tip { font-size: 13px; color: #16a34a; min-height: 18px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dl-notice { text-align: center; font-size: 13px; color: #8a93a6; margin: -28px 0 32px; }
.btn-disabled { background: #c3cad6; cursor: not-allowed; pointer-events: none; }

/* 用户服务 */
.service-card { text-align: center; }
.service-card p { margin-bottom: 16px; }
.btn-service { display: inline-block; background: #1a56db; color: #fff; text-decoration: none; padding: 9px 28px; border-radius: 6px; font-size: 14px; transition: background .2s; }
.btn-service:hover { background: #1448b8; }
.btn-service.btn-disabled { background: #c3cad6; }

/* 联系我们（简洁版） */
.contact-simple { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin: 0 auto; }
.contact-item { background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; padding: 36px 24px; text-align: center; }
.contact-item h3 { font-size: 17px; margin-bottom: 12px; color: #1f2a44; }
.contact-link { color: #1a56db; text-decoration: none; font-size: 15px; }
.contact-link:hover { text-decoration: underline; }
.contact-note { font-size: 12px; color: #8a93a6; margin-top: 8px; }
.qr-placeholder { width: 140px; height: 140px; margin: 0 auto; border: 1px dashed #c3cad6; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #8a93a6; line-height: 1.6; }

/* 访问统计 / 下载次数 */
.dl-count { font-size: 13px; color: #8a93a6; white-space: nowrap; background: #f0f3f9; padding: 4px 12px; border-radius: 20px; }
.visit-stats { margin-top: 8px; font-size: 12px; color: #7c86a0; }
.visit-stats span { color: #d3daf0; font-weight: 600; }
.admin-entry { color: #7c86a0; text-decoration: none; }
.admin-entry:hover { color: #d3daf0; text-decoration: underline; }

/* 认证页面（注册/登录） */
.auth-section { min-height: calc(100vh - 64px - 90px); }
.auth-card { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid #e8ecf3; border-radius: 12px; padding: 40px 36px; }
.auth-title { font-size: 24px; text-align: center; color: #1f2a44; }
.auth-sub { text-align: center; font-size: 13px; color: #8a93a6; margin: 8px 0 28px; }
.auth-card label { display: block; font-size: 14px; color: #4b5563; margin: 16px 0 6px; }
.auth-card input { width: 100%; border: 1px solid #d8dee9; border-radius: 6px; padding: 11px 14px; font-size: 14px; font-family: inherit; }
.auth-card input:focus { outline: none; border-color: #1a56db; }
.btn-block { width: 100%; margin-top: 24px; }
.auth-note { margin-top: 16px; font-size: 12px; color: #8a93a6; line-height: 1.7; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.btn-code { flex-shrink: 0; background: #eef4ff; color: #1a56db; border: 1px solid #c7d9f9; border-radius: 6px; padding: 0 16px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn-code:hover:not(:disabled) { background: #dce9fd; }
.btn-code:disabled { color: #8a93a6; border-color: #e8ecf3; cursor: not-allowed; }
.pwd-meter { height: 5px; background: #eef1f6; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.pwd-meter span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .25s, background .25s; }
.pwd-tip { font-size: 12px; color: #8a93a6; margin-top: 6px; }

/* 管理后台 */
.admin-tag { font-size: 13px; background: #1a56db; color: #fff; padding: 2px 10px; border-radius: 4px; vertical-align: middle; margin-left: 8px; }
.admin-head { text-align: center; margin-bottom: 36px; }
.admin-who { font-size: 14px; color: #5b6577; }
.stat-card { text-align: center; }
.stat-card h3 { font-size: 32px; color: #1a56db; }
.admin-sub-title { font-size: 19px; margin: 48px 0 18px; color: #1f2a44; }
.admin-sub-title .badge { position: static; margin-left: 10px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { background: #f6f8fb; text-align: left; padding: 12px 16px; color: #4b5563; font-weight: 600; white-space: nowrap; }
.admin-table td { padding: 12px 16px; border-top: 1px solid #eef1f6; color: #2b3445; white-space: nowrap; }
.role-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.role-superadmin { background: #fee2e2; color: #b91c1c; }
.role-admin { background: #eef4ff; color: #1a56db; }
.role-vip { background: #fef3c7; color: #b45309; }
.btn-mini { background: #eef4ff; color: #1a56db; border: 1px solid #c7d9f9; border-radius: 5px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.btn-mini:hover:not(:disabled) { background: #dce9fd; }
.btn-mini:disabled { opacity: .5; cursor: not-allowed; }

/* 信令调试台 */
.dbg-card { background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; padding: 22px 26px; margin-bottom: 24px; }
.dbg-title { font-size: 16px; color: #1f2a44; margin-bottom: 16px; }
.dbg-conn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dbg-addr { flex: 1; min-width: 260px; border: 1px solid #d8dee9; border-radius: 6px; padding: 10px 14px; font-size: 14px; font-family: Consolas, monospace; }
.dbg-addr:focus { outline: none; border-color: #1a56db; }
.dbg-btn { padding: 10px 18px; }
.dbg-status { font-size: 13px; padding: 5px 14px; border-radius: 20px; background: #f0f3f9; color: #8a93a6; }
.dbg-status.st-ok { background: #dcfce7; color: #16a34a; }
.dbg-status.st-ing { background: #fef3c7; color: #b45309; }
.dbg-status.st-err { background: #fee2e2; color: #b91c1c; }
.dbg-status.st-off { background: #f0f3f9; color: #8a93a6; }
.dbg-hint { margin-top: 12px; font-size: 12px; color: #8a93a6; }
.dbg-hint code { background: #f0f3f9; padding: 1px 6px; border-radius: 4px; font-family: Consolas, monospace; }
.dbg-metrics { margin-bottom: 24px; }
.dbg-ops { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dbg-ops input, .dbg-custom input { border: 1px solid #d8dee9; border-radius: 6px; padding: 9px 12px; font-size: 13px; font-family: inherit; }
.dbg-custom { display: flex; gap: 10px; flex-wrap: wrap; }
.dbg-custom #customData { flex: 1; min-width: 220px; font-family: Consolas, monospace; }
.dbg-log { background: #1f2a44; border-radius: 8px; height: 320px; overflow-y: auto; padding: 12px 16px; font-family: Consolas, monospace; font-size: 12px; }
.dbg-log-empty { color: #7c86a0; text-align: center; padding: 40px 0; }
.dbg-log-row { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); align-items: baseline; }
.dbg-log-time { color: #7c86a0; flex-shrink: 0; }
.dbg-log-dir { flex-shrink: 0; width: 42px; }
.dir-send .dbg-log-dir { color: #60a5fa; }
.dir-recv .dbg-log-dir { color: #4ade80; }
.dbg-log-type { color: #fbbf24; flex-shrink: 0; min-width: 70px; }
.dbg-log-body { color: #d3daf0; word-break: break-all; }

/* 页脚 */
footer { background: #1f2a44; color: #aab3c5; text-align: center; padding: 24px 0; font-size: 13px; }

/* 工具类：CSP 禁止内联样式，页面初始状态统一用类控制 */
.is-hidden { display: none; }
.section-title--tight { margin-bottom: 12px; }
.text-center { text-align: center; }
.dbg-input-sm { width: 220px; }
.pull-right { float: right; }
.form-tip.tip-err { color: #dc2626; }
.form-tip.tip-ok { color: #16a34a; }

/* 管理后台：表单 / 软件包 / 服务器面板 */
.admin-form-card { background: #fff; border: 1px solid #e8ecf3; border-radius: 10px; padding: 22px 26px; margin-bottom: 20px; }
.admin-form-title { font-size: 16px; color: #1f2a44; margin-bottom: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.form-row input { width: 100%; max-width: 420px; border: 1px solid #d8dee9; border-radius: 6px; padding: 10px 12px; font-size: 14px; font-family: inherit; }
.form-row input:focus { outline: none; border-color: #1a56db; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn-dlg { padding: 9px 24px; font-size: 14px; }
.btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fecaca; }
.upload-status { font-size: 13px; color: #5b6577; }
.op-group { display: flex; gap: 6px; }
.srv-output { background: #1f2a44; color: #d3daf0; border-radius: 8px; padding: 16px 18px; font-family: Consolas, monospace; font-size: 12px; line-height: 1.6; max-height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.admin-dialog { border: 1px solid #e8ecf3; border-radius: 12px; padding: 28px 30px; max-width: 460px; width: calc(100% - 48px); box-shadow: 0 24px 60px rgba(15,35,80,.22); }
.admin-dialog::backdrop { background: rgba(15,35,80,.45); }

@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .contact-wrap { grid-template-columns: 1fr; }
  .contact-simple { grid-template-columns: 1fr; }
  nav a { margin-left: 14px; font-size: 13px; }
}
