/* 易支付系统样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f4f6fa; color: #2b3442; line-height: 1.6; font-size: 14px;
}
a { color: #1677ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    background: #f2f5fa; padding: 2px 6px; border-radius: 4px;
    font-family: Consolas, Monaco, monospace; font-size: 12px; color: #0958d9;
    word-break: break-all;
}
code.small { font-size: 11px; }

/* 布局 */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 130px); }

/* 顶部导航 */
.topbar { background: #fff; box-shadow: 0 1px 8px rgba(20, 60, 120, .08); position: sticky; top: 0; z-index: 100; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 700; color: #1677ff; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.logo {
    width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #1677ff, #0958d9);
    color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.nav nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav nav a { color: #4a5568; padding: 8px 14px; border-radius: 6px; font-size: 14px; }
.nav nav a:hover { background: #f0f5ff; text-decoration: none; }
.nav nav a.active { color: #1677ff; background: #e6f0ff; font-weight: 600; }

/* 首页 */
.hero { text-align: center; padding: 56px 16px 36px; }
.hero h1 { font-size: 34px; color: #1c2b3e; margin-bottom: 12px; }
.hero p { font-size: 17px; color: #5a6a80; }
.hero-sub { font-size: 13px !important; color: #8a97aa !important; margin-top: 6px; }
.hero-actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px 0; }
.feature-card {
    background: #fff; border-radius: 12px; padding: 26px 22px;
    box-shadow: 0 2px 12px rgba(20, 60, 120, .06); transition: transform .15s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon {
    width: 46px; height: 46px; border-radius: 10px; background: #e6f0ff; color: #1677ff;
    display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; margin-bottom: 14px;
}
.feature-card h3 { font-size: 17px; margin-bottom: 8px; color: #1c2b3e; }
.feature-card p { color: #6b7a90; font-size: 13px; margin-bottom: 12px; }

.home-flow { margin-top: 26px; }
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step { font-size: 13px; color: #5a6a80; text-align: center; padding: 10px; }
.step span {
    display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: #1677ff; color: #fff;
    align-items: center; justify-content: center; margin-right: 6px; font-weight: 700;
}
.pay-channels { text-align: center; }
.channel-chip {
    display: inline-block; padding: 5px 16px; margin: 4px; border-radius: 20px;
    background: #f0f5ff; color: #1677ff; font-size: 13px; border: 1px solid #d6e4ff;
}

/* 按钮 */
.btn {
    display: inline-block; padding: 9px 22px; background: #1677ff; color: #fff; border: 1px solid #1677ff;
    border-radius: 8px; font-size: 14px; cursor: pointer; text-align: center; transition: background .15s;
}
.btn:hover { background: #0958d9; text-decoration: none; color: #fff; }
.btn-lg { padding: 12px 34px; font-size: 16px; border-radius: 10px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { display: block; width: 100%; }
.btn-plain { background: #fff; color: #1677ff; border-color: #bcd2f5; }
.btn-plain:hover { background: #f0f5ff; color: #0958d9; }
.btn-active { background: #1677ff; color: #fff; }
.btn-warn { background: #fa8c16; border-color: #fa8c16; }
.btn-warn:hover { background: #d46b08; }
.btn-ok { background: #52c41a; border-color: #52c41a; }
.btn-pay { width: 100%; padding: 13px; font-size: 17px; margin-top: 18px; border-radius: 10px; }

/* 面板/表格 */
.panel {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(20, 60, 120, .06);
    margin-bottom: 20px; overflow: hidden;
}
.panel-title {
    padding: 14px 20px; font-size: 15px; font-weight: 700; color: #1c2b3e;
    border-bottom: 1px solid #eef1f6; background: #fafbfd;
}
.panel-body { padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.page-head h2 { font-size: 20px; color: #1c2b3e; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f0f2f7; white-space: nowrap; }
.data-table th { background: #f8fafd; color: #5a6a80; font-weight: 600; }
.data-table tr:hover td { background: #fafcff; }
.data-table .empty { text-align: center; color: #9aa7ba; padding: 34px; }
.data-table .money { color: #f5222d; font-weight: 600; }
.data-table .ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { padding: 10px 8px; border-bottom: 1px dashed #eef1f6; font-size: 13px; text-align: left; vertical-align: middle; }
.kv-table th { width: 180px; color: #5a6a80; font-weight: 600; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.tag-green { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-red { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.tag-gray { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 22px; text-align: center; box-shadow: 0 2px 12px rgba(20, 60, 120, .06); }
.stat-num { font-size: 26px; font-weight: 700; color: #1677ff; }
.stat-label { font-size: 13px; color: #8a97aa; margin-top: 6px; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: #4a5568; margin-bottom: 6px; font-weight: 600; }
.form-row input, .form-row select, .search-input {
    width: 100%; padding: 9px 12px; border: 1px solid #d9e1ec; border-radius: 8px; font-size: 14px; outline: none;
    font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .search-input:focus {
    border-color: #1677ff; box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
.field-tip { font-size: 12px; color: #9aa7ba; margin-top: 5px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2col { grid-template-columns: 1fr 1fr; align-items: start; }
.inline-form { max-width: 460px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-bar .search-input { width: 220px; }

/* 登录/注册 */
.auth-box {
    max-width: 400px; margin: 40px auto; background: #fff; border-radius: 12px;
    padding: 32px 30px; box-shadow: 0 6px 28px rgba(20, 60, 120, .1);
}
.auth-box h2 { text-align: center; margin-bottom: 22px; color: #1c2b3e; font-size: 22px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: #8a97aa; }

.alert { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; background: #f0f5ff; border: 1px solid #d6e4ff; color: #1677ff; }
.alert-err { background: #fff2f0; border-color: #ffccc7; color: #cf1322; }

/* 分页 */
.pager { text-align: center; padding: 16px; }
.pager a, .pager .cur {
    display: inline-block; min-width: 34px; padding: 6px 10px; margin: 0 3px; border-radius: 6px;
    border: 1px solid #d9e1ec; font-size: 13px; color: #4a5568;
}
.pager a:hover { border-color: #1677ff; color: #1677ff; text-decoration: none; }
.pager .cur { background: #1677ff; color: #fff; border-color: #1677ff; }

/* 收银台 */
.cashier { max-width: 560px; margin: 24px auto; }
.cashier-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 34px rgba(20, 60, 120, .1); }
.cashier-head {
    background: linear-gradient(135deg, #1677ff, #0958d9); color: #fff; padding: 24px 28px;
}
.cashier-head .shop { font-size: 15px; opacity: .9; }
.cashier-head .amount { margin-top: 8px; }
.cashier-head .amount small { font-size: 13px; opacity: .85; }
.cashier-head .money { font-size: 36px; font-weight: 700; }
.cashier-body { padding: 26px 28px; }
.goods { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #f0f2f7; margin-bottom: 18px; gap: 12px; }
.goods-name { font-weight: 600; color: #2b3442; }
.goods-no { font-size: 12px; color: #9aa7ba; }
.pay-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pay-type {
    position: relative; border: 2px solid #e6eaf2; border-radius: 10px; padding: 16px 8px;
    text-align: center; cursor: pointer; transition: all .15s; display: block;
}
.pay-type:hover { border-color: #91b8ff; }
.pay-type input { position: absolute; opacity: 0; }
.pay-type input:checked ~ .pt-check { border-color: #1677ff; background: #1677ff; }
.pay-type input:checked ~ .pt-check::after { content: ""; display: block; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.pay-type:has(input:checked) { border-color: #1677ff; background: #f5f9ff; }
.pt-icon {
    width: 38px; height: 38px; border-radius: 9px; margin: 0 auto 8px; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700;
}
.t-alipay .pt-icon { background: #1677ff; }
.t-wxpay .pt-icon { background: #07c160; }
.t-qqpay .pt-icon { background: #12b7f5; }
.pt-label { font-size: 13px; color: #4a5568; display: block; }
.pt-check {
    position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #d0d8e6; display: flex; align-items: center; justify-content: center; background: #fff;
}
.cashier-tip { text-align: center; font-size: 12px; color: #9aa7ba; margin-top: 14px; }

/* 模拟网关 */
.gateway-card { background: #fff; border-radius: 14px; padding: 26px 28px; box-shadow: 0 8px 34px rgba(20, 60, 120, .1); text-align: center; }
.gw-banner { padding: 14px; border-radius: 10px; color: #fff; font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.gw-banner .gw-logo { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; }
.gw-alipay { background: #1677ff; }
.gw-wxpay { background: #07c160; }
.gw-qqpay { background: #12b7f5; }
.gw-amount { font-size: 34px; font-weight: 700; color: #f5222d; margin: 20px 0 10px; }
.gw-qr p { font-size: 13px; color: #8a97aa; margin: 10px 0 18px; }
.qr-box {
    width: 190px; height: 190px; margin: 0 auto; border: 1px solid #e6eaf2; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; padding: 12px;
    background:
        linear-gradient(45deg, #1c2b3e 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(-45deg, #1c2b3e 25%, transparent 25%) 0 8px / 16px 16px,
        linear-gradient(45deg, transparent 75%, #1c2b3e 75%) 8px -8px / 16px 16px,
        linear-gradient(-45deg, transparent 75%, #1c2b3e 75%) -8px 0 / 16px 16px,
        #fff;
}
.qr-inner {
    background: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: #bbb; text-align: center; word-break: break-all; padding: 8px;
}
.qr-box-img {
    background: #fff; padding: 8px;
}
.qr-box-img img {
    width: 100%; height: 100%; object-fit: contain; display: block;
}
.gw-info { text-align: left; background: #f8fafd; border-radius: 10px; padding: 14px 18px; margin: 18px 0; font-size: 13px; color: #5a6a80; }
.gw-info p { margin: 4px 0; }
.gateway-card form .btn { width: 100%; }

/* 结果页 */
.cashier-success {
    max-width: 480px; margin: 40px auto; background: #fff; border-radius: 14px; padding: 40px 30px;
    text-align: center; box-shadow: 0 8px 34px rgba(20, 60, 120, .1);
}
.ok-icon {
    width: 70px; height: 70px; border-radius: 50%; background: #52c41a; color: #fff;
    font-size: 38px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.wait-icon {
    width: 70px; height: 70px; border-radius: 50%; background: #faad14; color: #fff;
    font-size: 38px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.cashier-success h2 { font-size: 22px; margin-bottom: 12px; color: #1c2b3e; }
.cashier-success p { color: #5a6a80; margin: 6px 0; }
.cashier-success .money { color: #f5222d; font-size: 20px; }
.cashier-success .btn { margin-top: 20px; }

.pay-error {
    max-width: 460px; margin: 60px auto; background: #fff; border-radius: 14px; padding: 40px 30px;
    text-align: center; box-shadow: 0 8px 34px rgba(20, 60, 120, .1);
}
.pay-error-icon {
    width: 64px; height: 64px; border-radius: 50%; background: #ff4d4f; color: #fff;
    font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.pay-error h2 { font-size: 20px; margin-bottom: 10px; }
.pay-error p { color: #8a97aa; margin-bottom: 20px; word-break: break-all; }

/* 文档 */
.doc-ol { padding-left: 22px; color: #5a6a80; font-size: 13px; line-height: 2; }
.code {
    display: block; background: #1e293b; color: #d7e3f4; padding: 16px; border-radius: 8px;
    font-family: Consolas, Monaco, monospace; font-size: 12.5px; line-height: 1.7;
    overflow-x: auto; white-space: pre; margin: 12px 0;
}
.word-break { word-break: break-all; }
.test-result { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 8px; padding: 14px 16px; margin-top: 18px; font-size: 13px; line-height: 1.9; }
.notify-log { margin-top: 20px; }

/* 开关 */
.switch-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* 页脚 */
.footer { background: #fff; border-top: 1px solid #eef1f6; padding: 20px 0; text-align: center; color: #9aa7ba; font-size: 12px; }

/* 响应式 */
@media (max-width: 860px) {
    .feature-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .flow-steps { grid-template-columns: repeat(2, 1fr); }
    .grid-2col { grid-template-columns: 1fr; }
    .nav { height: auto; padding: 8px 0; }
}
@media (max-width: 520px) {
    .grid2 { grid-template-columns: 1fr; }
    .pay-types { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-num { font-size: 20px; }
    .filter-bar .search-input { width: 100%; }
}
