/* 代付后台 — 白色主题 */
:root {
    --page-bg: #f5f7fa;
    --surface: #ffffff;
    --border: #e4e7ed;
    --primary: #2563eb;
    --text: #1f2937;
    --text-muted: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --sidebar-width: 220px;
    --header-height: 56px;
}

* { box-sizing: border-box; }

body.panel-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--page-bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.panel-shell { min-height: 100vh; display: flex; flex-direction: column; }

.panel-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.panel-brand { font-weight: 600; font-size: 16px; color: var(--text); }
.panel-brand span { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 8px; }

.panel-user { color: var(--text-muted); font-size: 13px; }
.panel-user form { display: inline; margin-left: 12px; }

.panel-main { display: flex; flex: 1; }

.panel-sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    flex-shrink: 0;
}

.panel-nav a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.panel-nav a:hover { background: #f9fafb; text-decoration: none; }
.panel-nav a.active {
    background: #eff6ff;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.panel-nav .nav-group { margin-top: 8px; }
.panel-nav .nav-group-title {
    padding: 8px 20px 4px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.panel-content { flex: 1; padding: 20px 24px; min-width: 0; }

.page-title { margin: 0 0 16px; font-size: 20px; font-weight: 600; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.stat-item .label { color: var(--text-muted); font-size: 13px; }
.stat-item .value { font-size: 24px; font-weight: 600; margin-top: 8px; }
.stat-foot { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }
.stat-unit { font-size: 16px; font-weight: 500; margin-left: 2px; }
.stat-item-accent { border-left: 3px solid var(--primary); }
.stats-dashboard { margin-bottom: 20px; }

.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dashboard-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 960px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
.dashboard-merchant-card {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}
.dashboard-merchant-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 20px 16px;
    background: linear-gradient(160deg, #f0f7ff 0%, #fff 55%);
    border-bottom: 1px solid var(--border);
}
.dashboard-merchant-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.dashboard-merchant-intro { flex: 1; min-width: 0; }
.dashboard-merchant-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}
.dashboard-merchant-meta {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.dashboard-merchant-no {
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
}
.dashboard-merchant-dot { margin: 0 4px; opacity: 0.5; }
.dashboard-merchant-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    border-radius: 999px;
}
.dashboard-merchant-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    margin: 0;
}
.dashboard-metric {
    background: var(--surface);
    padding: 14px 16px;
    text-align: center;
}
.dashboard-metric strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.dashboard-metric-text {
    font-size: 14px !important;
    font-weight: 600 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.dashboard-metric span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.dashboard-merchant-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 20px;
}
.dashboard-merchant-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}
.code-inline { font-size: 12px; word-break: break-all; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-card h1 { margin: 0 0 8px; font-size: 22px; text-align: center; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 13px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: #1d4ed8; }
.btn-link { background: none; color: var(--primary); padding: 0; border: none; cursor: pointer; font-size: 13px; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-weight: 500; font-size: 13px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-muted { background: #f3f4f6; color: #6b7280; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.btn-sm-inline { width: auto; padding: 8px 14px; }
.btn-muted-inline { display: inline-block; margin-left: 8px; color: var(--text-muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { margin-top: 8px; }
.form-hint { color: var(--text-muted); font-size: 13px; }
.form-section-title { margin: 24px 0 12px; font-size: 15px; font-weight: 600; }
.form-section-title:first-of-type { margin-top: 0; }
.form-check-inline label { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.preview-logo, .table-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; vertical-align: middle; }
.product-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #f3f4f6; display: block; }
.alert-success-inline { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }

.nav-group-platforms .nav-group-title {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}
.panel-nav a.nav-platform-link {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.panel-nav a.nav-platform-link span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-platform-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}
.table-logo, .preview-logo, .pay-logo {
    object-fit: contain;
    background: #fff;
}
.nav-empty { display: block; padding: 8px 20px; color: var(--text-muted); font-size: 12px; }

.pay-mock-wrap { display: flex; justify-content: center; }
.pay-mock-phone {
    width: 375px;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    background: #fff;
}
.pay-screen { padding: 20px 16px 24px; min-height: 520px; background: #f7f7f7; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.pay-header { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 20px; }
.pay-logo { width: 36px; height: 36px; border-radius: 10px; }
.pay-amount-box { background: #fff; border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 16px; }
.pay-label { color: #888; font-size: 13px; margin: 0 0 8px; }
.pay-amount { font-size: 32px; font-weight: 700; margin: 0; color: #222; }
.pay-order { font-size: 12px; color: #999; margin: 12px 0 0; }
.pay-section-title { font-size: 13px; color: #666; margin: 0 0 8px; }
.pay-methods { background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.pay-method { display: block; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.pay-method:last-child { border-bottom: none; }
.pay-method.active { color: #222; font-weight: 600; }
.pay-submit {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: var(--brand, #FFC300);
    color: #222;
    cursor: pointer;
}
.pay-submit--eleme { color: #fff; border-radius: 8px; }
.pay-header--eleme span { color: #0097FF; }
.pay-amount--eleme { color: #0097FF; }
.pay-footer-tip { text-align: center; font-size: 12px; color: #aaa; margin-top: 16px; }

.platform-page-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 960px) {
    .platform-page-layout { grid-template-columns: 1fr; }
}
.platform-goods-title { margin: 0 0 16px; font-size: 16px; }
.platform-goods-form .form-group { margin-bottom: 12px; }
.platform-goods-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.platform-goods-price { margin-left: 8px; color: var(--primary); font-weight: 600; }
.platform-goods-total {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    text-align: right;
    font-size: 15px;
}
.pay-cart-box {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.pay-cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f3f3;
    font-size: 14px;
}
.pay-cart-row--with-cover { gap: 10px; }
.pay-cart-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.pay-cart-row:last-child { border-bottom: none; }
.pay-cart-name { flex: 1; padding-right: 8px; }
.pay-cart-price { font-weight: 600; color: #222; }
.pay-cart-empty { color: #999; font-size: 13px; margin: 8px 0; text-align: center; }
.pay-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.nav-platform-sub {
    display: block;
    padding: 6px 20px 6px 46px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
}
.nav-platform-sub:hover { background: #f9fafb; color: var(--primary); text-decoration: none; }
.nav-platform-sub.active {
    background: #eff6ff;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}
.platform-add-form {
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: 16px;
    align-items: end;
}
.platform-add-form .form-group { margin-bottom: 0; }
@media (max-width: 768px) {
    .platform-add-form { grid-template-columns: 1fr; }
    .platform-add-form .form-group { margin-bottom: 12px; }
}
.pay-mock-wrap--page { padding: 24px 0 40px; }
.page-toolbar .btn-muted-inline {
    margin-left: 0;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: #fff;
}
.page-toolbar .btn-muted-inline:hover { background: #f9fafb; text-decoration: none; }

.page-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-search-form { display: flex; align-items: center; gap: 8px; }
.toolbar-search-input { width: 200px; padding: 8px 12px; font-size: 14px; }

.product-list-filters {
    margin-bottom: 16px;
    padding: 14px 16px;
}
.product-filter-form { display: flex; flex-direction: column; gap: 12px; }
.product-filter-main {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 100px auto 100px auto;
    gap: 10px 8px;
    align-items: end;
}
.product-filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-filter-field--search { grid-column: 1; }
.product-filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.product-filter-price-sep {
    align-self: end;
    padding-bottom: 10px;
    color: var(--text-muted);
    font-size: 14px;
}
.product-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    align-self: end;
}
.product-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.product-filter-preset {
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.product-filter-preset:hover {
    background: #f9fafb;
    text-decoration: none;
}
.product-filter-preset.is-active {
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary, #2563eb);
    font-weight: 600;
}
.product-filter-result-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.platform-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}
.platform-style-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--surface);
}
.platform-style-card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1); }
.platform-style-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 80px;
    padding: 10px 8px;
    background: var(--platform-brand, #2563eb);
    color: #fff;
    text-align: center;
}
.platform-style-card-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 14px;
    font-weight: 700;
}
.platform-style-card-logo { display: none; }
.platform-style-card-name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.platform-style-card-tagline {
    margin: 0;
    font-size: 11px;
    opacity: 0.9;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.platform-style-card-foot {
    padding: 7px 6px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
@media (min-width: 900px) {
    .platform-style-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}
.platform-picker-float-hint { display: none; }
.platform-switch-link { display: none; }
@media (min-width: 769px) and (max-width: 1100px) {
    .product-filter-main {
        grid-template-columns: minmax(160px, 1fr) 88px auto 88px auto;
    }
}
.nav-platform-search {
    display: block;
    width: calc(100% - 24px);
    margin: 0 12px 8px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}
.product-catalog-list {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fafb;
}
.product-catalog-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}
.product-catalog-item:last-child { border-bottom: none; }
.product-catalog-item:hover { background: #eff6ff; }
.product-catalog-shop { color: var(--text-muted); font-size: 12px; }
.product-catalog-name { color: var(--text); }
.product-catalog-price { color: var(--primary); font-weight: 500; font-size: 12px; white-space: nowrap; }

.product-catalog-details { margin-bottom: 4px; }
.product-catalog-details-summary {
    display: none;
    padding: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
}
.product-catalog-details-summary::-webkit-details-marker { display: none; }
.product-catalog-details .product-catalog-wrap { margin-bottom: 0; }
.btn-outline {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.btn-outline:hover { background: #f9fafb; text-decoration: none; color: var(--text); }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}
.modal-backdrop.is-open { display: flex; }
.modal-dialog {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-title { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 20px;
}
.modal-footer .btn-sm-inline { width: auto; min-width: 72px; }

.share-cell { min-width: 280px; }
.share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.share-link-input {
    flex: 1;
    min-width: 160px;
    font-size: 12px;
    padding: 6px 8px;
}
.share-link-row .btn-sm-inline { padding: 6px 10px; font-size: 12px; }

.detail-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 16px;
    margin: 0;
    font-size: 14px;
}
.detail-list dt { margin: 0; color: var(--text-muted); }
.detail-list dd { margin: 0; }
