/* B2B 客户端 — 扁平紧凑风格 */
*, *::before, *::after { box-sizing: border-box; }
body.b2b-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    line-height: 1.5;
}
.b2b-topbar {
    background: #1e3a5f;
    color: #fff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}
.b2b-topbar .brand { font-weight: 700; font-size: 16px; }
.b2b-topbar .user-info { font-size: 12px; opacity: 0.9; }
.b2b-nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 8px;
}
.b2b-nav a {
    display: inline-block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 2px solid transparent;
}
.b2b-nav a:hover, .b2b-nav a.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}
.b2b-subnav {
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
}
.b2b-subnav a {
    font-size: 12px;
    padding: 8px 12px;
}
.b2b-main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.b2b-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}
.b2b-card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.b2b-flow {
    color: #666;
    font-size: 13px;
    padding: 10px 12px;
    background: #fafafa;
    border-left: 3px solid #1e3a5f;
    margin-bottom: 16px;
}
.b2b-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.b2b-quick-item {
    display: block;
    text-align: center;
    padding: 16px 8px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: border-color 0.2s;
}
.b2b-quick-item:hover { border-color: #1e3a5f; color: #1e3a5f; }
.b2b-quick-item .icon { font-size: 28px; margin-bottom: 8px; }
.b2b-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.b2b-btn:hover { background: #2d6a9f; color: #fff; }
.b2b-btn-outline {
    background: #fff;
    color: #1e3a5f;
    border: 1px solid #1e3a5f;
}
.b2b-form-row { margin-bottom: 12px; }
.b2b-form-row label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.b2b-form-row input, .b2b-form-row select, .b2b-form-row textarea {
    width: 100%;
    max-width: 480px;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}
.b2b-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.b2b-table th, .b2b-table td {
    border: 1px solid #e8e8e8;
    padding: 8px 10px;
    text-align: left;
}
.b2b-table th { background: #fafafa; font-weight: 600; }
.b2b-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.b2b-tabs a {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
}
.b2b-tabs a.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.b2b-empty { text-align: center; color: #999; padding: 40px 16px; }
.b2b-footer-links { font-size: 12px; color: #999; margin-top: 24px; text-align: center; }
@media (max-width: 768px) {
    .b2b-main { padding: 12px; }
    .b2b-nav a { padding: 8px 10px; font-size: 12px; }
}

/* 建单页 — 分区表单 */
.b2b-order-page { padding-bottom: 72px; }
.b2b-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f5f5f5;
    padding: 8px 0;
}
.b2b-section-nav a {
    padding: 6px 14px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}
.b2b-section-nav a:hover { border-color: #1e3a5f; color: #1e3a5f; }
.b2b-form-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}
.b2b-section-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #f0f4f8 0%, #fff 100%);
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
}
.b2b-section-hd .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1e3a5f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.b2b-form-grid {
    display: grid;
    gap: 12px 16px;
    padding: 16px;
}
.b2b-form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.b2b-form-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}
.b2b-form-field label em.req { color: #e74c3c; font-style: normal; }
.b2b-form-field input,
.b2b-form-field select,
.b2b-form-field textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.15s;
}
.b2b-form-field input:focus,
.b2b-form-field select:focus,
.b2b-form-field textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}
.b2b-form-field-span2 { grid-column: span 2; }
.b2b-inv-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px 0;
}
.b2b-inv-tip { font-size: 12px; color: #999; }
.b2b-inv-scroll {
    overflow-x: auto;
    padding: 12px 16px 16px;
}
.b2b-inv-table { min-width: 920px; }
.b2b-inv-table input,
.b2b-inv-table select {
    width: 100%;
    min-width: 60px;
    padding: 5px 6px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    font-size: 12px;
}
.b2b-inv-table .col-sku { min-width: 80px; }
.b2b-inv-table .col-cn { min-width: 100px; }
.b2b-inv-table .col-en { min-width: 100px; }
.b2b-inv-table .col-hs { min-width: 90px; }
.b2b-inv-table .col-qty { width: 64px; }
.b2b-inv-table .col-price { width: 80px; }
.b2b-inv-table .col-cur { width: 72px; }
.b2b-inv-table .col-wt { width: 72px; }
.b2b-btn-sm { padding: 5px 12px; font-size: 13px; }
.b2b-form-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    z-index: 100;
}
.b2b-form-actions-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.b2b-form-actions-spacer { flex: 1; }
@media (max-width: 992px) {
    .b2b-form-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .b2b-form-field-span2 { grid-column: span 2; }
}
@media (max-width: 576px) {
    .b2b-form-grid-3 { grid-template-columns: 1fr; }
    .b2b-form-field-span2 { grid-column: span 1; }
    .b2b-section-nav { position: static; }
}

/* 批量上传 — 左右分栏 */
.b2b-batch-page { padding-bottom: 16px; }
.b2b-batch-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}
.b2b-batch-left .b2b-batch-form { padding: 16px; }
.b2b-file-row { display: flex; gap: 8px; }
.b2b-file-path { flex: 1; background: #fafafa; }
.b2b-file-btn { position: relative; overflow: hidden; white-space: nowrap; margin: 0; }
.b2b-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.b2b-batch-options { margin: 12px 0; padding: 10px 12px; background: #fafafa; border-radius: 4px; }
.b2b-check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.b2b-hint { font-size: 12px; color: #999; margin: 4px 0 0; line-height: 1.5; }
.b2b-batch-actions { margin-top: 16px; }
.b2b-import-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
}
.b2b-import-result.is-ok { background: #f0faf0; border: 1px solid #b7e1b7; color: #2d6a2d; }
.b2b-import-result.is-warn { background: #fffbf0; border: 1px solid #f0d78c; color: #8a6d00; }
.b2b-import-result.is-err { background: #fff5f5; border: 1px solid #f5b7b7; color: #a94442; }
.b2b-import-result ul { margin: 8px 0 0 18px; padding: 0; }
.b2b-batch-right { padding: 0; overflow: hidden; }
.b2b-batch-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
}
.b2b-batch-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
}
.b2b-batch-tab.active {
    color: #1e3a5f;
    font-weight: 600;
    border-bottom-color: #1e3a5f;
    background: #fff;
}
.b2b-batch-panel { display: none; padding: 16px; }
.b2b-batch-panel.active { display: block; }
.b2b-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}
.b2b-tpl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: border-color 0.15s;
}
.b2b-tpl-item:hover { border-color: #1e3a5f; color: #1e3a5f; }
.b2b-tpl-icon { font-size: 32px; margin-bottom: 6px; }
.b2b-tpl-name { font-size: 12px; text-align: center; line-height: 1.3; }
.b2b-note-list { margin: 0; padding-left: 18px; font-size: 13px; color: #555; line-height: 1.7; }
.b2b-channel-list .b2b-channel-item {
    margin: 0 0 8px;
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 13px;
}
@media (max-width: 992px) {
    .b2b-batch-layout { grid-template-columns: 1fr; }
}
