/* ===== 全局样式 ===== */
:root {
    --primary: #4f6ef6;
    --primary-dark: #3b54d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f0f2f7;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
    --radius: 12px;
    --radius-sm: 8px;

    /* tom-select (bootstrap5) 所需变量映射 */
    --bs-border-color: #cbd5e1;
    --bs-border-color-translucent: rgba(0,0,0,.175);
    --bs-border-width: 1px;
    --bs-border-radius: 6px;
    --bs-body-bg: #fff;
    --bs-body-color: #1e293b;
    --bs-secondary-bg: #e9ecef;
    --bs-tertiary-bg: #f8f9fa;
    --bs-box-shadow-inset: inset 0 1px 2px rgba(0,0,0,.075);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== 导航栏 ===== */
.navbar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.navbar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.navbar-nav .nav-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    transition: all .2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e2e8f0;
    font-size: .85rem;
}

.btn-logout {
    background: rgba(255,255,255,.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    transition: all .2s;
}

.btn-logout:hover { background: rgba(255,255,255,.2); }

/* 账户菜单（文字符号触发，悬浮弹出） */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.user-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 3px 6px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 4px;
    color: #e2e8f0;
    cursor: pointer;
    font-size: .7rem;
    letter-spacing: 0;
    transition: all .2s;
    user-select: none;
}
.user-menu-btn:hover,
.user-menu:hover .user-menu-btn {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 90px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 50;
}
.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-menu-item {
    display: block;
    padding: 5px 12px;
    color: var(--text);
    font-size: .78rem;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.user-menu-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.user-menu-item.danger:hover {
    background: #fef2f2;
    color: var(--danger);
}

/* ===== 主容器 ===== */
.main-container {
    max-width: 95vw;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,110,246,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { opacity: .9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 表格 ===== */
.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
}

table tbody tr:hover { background: #f8fafc; }

table tbody tr:last-child td { border-bottom: none; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: .88rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    transition: border-color .2s, box-shadow .2s;
    background: #f9fafb;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,246,.12);
    background: #fff;
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 10px center; background-repeat: no-repeat; background-size: 20px; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== 模态框 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    width: 92%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 { margin-bottom: 20px; font-size: 1.1rem; font-weight: 600; }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    z-index: 300;
    animation: toastIn .3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== 搜索栏 ===== */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar .form-control { max-width: 300px; }

/* 品类链接 */
.goods-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}

.goods-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ===== 询价表页 ===== */
/* 白色信纸卡片 */
.quote-paper {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
    overflow: hidden;
}

/* 表头区域 */
.quote-head {
    padding: 32px 36px 24px;
    border-bottom: 3px solid #1e3a5f;
    background: linear-gradient(to bottom, #fafbfc, #fff);
}

.quote-logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.quote-logo-icon {
    width: 52px; height: 52px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e3a5f, #2c5aa0);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.quote-logo-img {
    height: 52px;
    width: auto;
    border-radius: 8px;
    flex-shrink: 0;
}

.quote-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 2px;
    margin: 0;
}

.quote-subtitle {
    font-size: .95rem;
    font-weight: 600;
    color: #dc2626;
    margin-top: 2px;
}

/* 信息表 */
.quote-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.quote-info-table td {
    padding: 5px 0;
    vertical-align: middle;
}

.info-label {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    padding-right: 8px !important;
    width: 90px;
}

.info-value {
    color: #1e293b;
    font-weight: 500;
    padding-right: 32px !important;
}

.info-input {
    border: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 3px 4px;
    font-size: .88rem;
    font-family: inherit;
    color: #1e293b;
    background: transparent;
    outline: none;
    transition: border-color .2s;
}

.info-input:focus { border-bottom-color: #2563eb; }

#taxPrice {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
}

/* 报价明细表格 */
.quote-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.quote-table thead th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: .82rem;
    color: #475569;
    padding: 10px 14px;
    text-align: left;
    letter-spacing: .5px;
    border-bottom: 2px solid #cbd5e1;
}

.col-cat  { width: 11%; }
.col-prod { width: 24%; }
.col-qty  { width: 6%; }
.col-spec { width: 32%; }
.col-sub  { width: 9%; }
.col-act  { width: 4%; }
.col-check { width: 4%; text-align: center; }

.quote-table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.quote-table tbody tr:hover { background: #f8fafc; }
.quote-table tbody tr:last-child td { border-bottom-color: #e2e8f0; }

/* ===== 横向滚动报价表 ===== */
.quote-table-wrap {
    overflow-x: auto;
    margin: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.quote-table-h {
    border-collapse: collapse;
    width: 100%;
    min-width: 1230px;
    table-layout: fixed;
    font-size: .82rem;
}

.quote-table-h thead th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    padding: 8px 6px;
    text-align: center;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
    overflow: visible;
}

.quote-table-h tbody td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    vertical-align: middle;
    overflow: hidden;
}

.quote-table-h tbody tr:hover { background: #f8fafc; }
.quote-table-h .col-chk { width: 36px; }
.quote-table-h .col-act { width: 36px; }
.quote-table-h .qty-input { width: 58px; text-align: center; }
.quote-table-h .sub-cell { font-weight: 600; color: var(--danger); }
.quote-table-h .empty-row td { text-align: center; padding: 40px; color: #94a3b8; }

/* 备注列：超长内容省略 + 悬浮弹出完整内容 */
.quote-table-h .remarks-cell {
    max-width: 100%;
    overflow: hidden;
}
.quote-table-h .cell-ellipsis {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: help;
    position: relative;
}
.quote-table-h .cell-ellipsis:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .75rem;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 320px;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    text-align: left;
}

/* ===== 筛选下拉框 - Tom Select 覆盖样式 ===== */
/* 原生select由tom-select自动隐藏，这里只覆盖tom-select生成的控件外观 */

/* 整体wrapper */
.quote-table-h thead th .ts-wrapper {
    min-height: 0 !important;
    width: 100%;
    position: relative;
}

/* 控件主体 — 无箭头，文字占满 */
.quote-table-h thead th .ts-wrapper .ts-control {
    padding: 4px 8px !important;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    color: #1e293b;
    background: #fff !important;
    cursor: pointer;
    min-height: 28px !important;
    max-height: 28px;
    line-height: 1.4;
    transition: none !important;
}

/* 彻底隐藏tom-select默认箭头 */
.ts-wrapper .ts-control::after,
.ts-wrapper.single .ts-control::after,
.ts-wrapper.dropdown-active .ts-control::after {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
}

/* 筛选激活时，控件加底色提示 */
.quote-table-h thead th .ts-wrapper.filter-active .ts-control {
    background: #eff6ff !important;
    border-color: var(--primary) !important;
}

/* 选中项文字：超长省略 */
.ts-wrapper .ts-control .item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.4;
}

/* 输入框 — 隐藏光标，纯筛选不需要编辑输入 */
.ts-wrapper .ts-control > input {
    font-size: .82rem !important;
    font-weight: 500 !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
    caret-color: transparent !important;
}

/* 悬浮 */
.ts-wrapper:hover .ts-control {
    border-color: var(--primary);
}

/* 聚焦 */
.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79,110,246,.12) !important;
}

/* ===== 下拉面板 ===== */
/* 强制白色不透明背景 + 高z-index + 宽度自适应，防止穿透/透明/重叠 */
.ts-dropdown {
    background: #fff !important;
    z-index: 9999 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 0 6px 6px !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.15) !important;
    padding: 4px 0 !important;
    opacity: 1 !important;
    width: max-content !important;
    min-width: 140px;
    max-width: 320px;
}

/* 下拉内容区域 */
.ts-dropdown .ts-dropdown-content {
    max-height: 240px;
    overflow-y: auto;
    padding: 0 !important;
}

/* 下拉选项 */
.ts-dropdown .option {
    white-space: nowrap;
    font-size: .82rem;
    color: #1e293b;
    cursor: pointer;
    padding: 6px 12px !important;
    line-height: 1.5;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background: #f1f5f9 !important;
    color: var(--primary);
}

.ts-dropdown .option.selected {
    background: var(--primary) !important;
    color: #fff !important;
}

.ts-dropdown .option.selected:hover,
.ts-dropdown .option.selected.active {
    background: #3b5bdb !important;
    color: #fff !important;
}

/* 空选项（占位符） */
.ts-dropdown .option[data-value=""] {
    color: #94a3b8;
    font-style: italic;
}

.ts-dropdown .option[data-value=""]:hover,
.ts-dropdown .option[data-value=""].active {
    color: var(--primary);
    font-style: italic;
}

/* 简化表头 */
.quote-simple-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 28px 18px;
    border-bottom: 3px solid #1e3a5f;
    background: linear-gradient(to bottom, #fafbfc, #fff);
}

.quote-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quote-count-tip {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-right: 4px;
}
.quote-count-tip b { color: var(--primary); font-size: .95rem; }

/* ===== 宽弹窗（产品表单双列） ===== */
.modal-wide { max-width: 700px !important; }

.form-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.form-two-col .form-group {
    margin-bottom: 14px;
}

.form-two-col .form-group label {
    font-size: .85rem;
}

/* 复选框列 */
.check-cell { text-align: center; vertical-align: middle; }
.check-cell input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.col-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* 品类标签 */
.cat-cell { font-weight: 500; }

.cat-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .5px;
}

/* 产品下拉 */
.prod-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: .85rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 18px;
    padding-right: 30px;
}

.prod-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.prod-select:disabled { background: #f9fafb; color: #94a3b8; cursor: not-allowed; }

/* 数量输入 */
.qty-input {
    width: 56px;
    padding: 7px 6px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: .88rem;
    font-family: inherit;
    color: #1e293b;
    transition: border-color .2s;
}

.qty-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* 参数列 */
.spec-cell {
    font-size: .82rem;
    color: #475569;
    line-height: 1.55;
    word-break: break-all;
}

/* 小计列 */
.sub-cell {
    font-weight: 700;
    color: #2563eb;
    font-size: .92rem;
    white-space: nowrap;
}

/* 删除按钮 */
.btn-icon-del {
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-icon-del:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* 空状态 */
.empty-row td {
    text-align: center;
    padding: 48px 20px !important;
    color: #94a3b8;
    font-size: .92rem;
}

/* 合计行 */
.total-row td {
    padding: 16px 14px !important;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    background: #fafbfc;
    border-top: 2px solid #1e3a5f;
}

.total-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
}

/* ===== 利润 & 加工费 ===== */
.extra-fee-row {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    padding: 14px 14px 8px;
    border-top: 1px solid #e2e8f0;
    margin-top: 0;
}

.fee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    color: var(--text);
}

.fee-item label {
    font-weight: 500;
    white-space: nowrap;
}

.fee-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    text-align: right;
    outline: none;
    transition: border-color .2s;
}

.fee-input:focus { border-color: var(--primary); }

.fee-unit {
    color: var(--text-secondary);
    font-size: .85rem;
}

/* ===== 合计行 ===== */
.total-row-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 14px 14px;
    gap: 8px;
}

.total-row-bar .total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.total-row-bar .total-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--danger);
}

/* 操作按钮区 */
.quote-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
}

/* 重要提示 */
.quote-notes {
    padding: 20px 36px 28px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.quote-notes .notes-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: .92rem;
}

.quote-notes ol {
    padding-left: 22px;
    color: #64748b;
    font-size: .83rem;
    line-height: 2;
}

.quote-notes ol li::marker { color: #dc2626; font-weight: 600; }

.quote-notes b { color: #dc2626; }

/* ===== 汇总栏 ===== */
.summary-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.summary-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-total span { font-size: .9rem; color: var(--text-secondary); font-weight: 400; }

/* ===== 产品列表 ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all .2s;
}

.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
}

.product-card .p-info { padding: 14px 16px; }

.product-card .p-name {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 4px;
}

.product-card .p-goods {
    font-size: .8rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.product-card .p-price {
    font-weight: 700;
    color: var(--danger);
    font-size: 1.05rem;
}

.product-card .p-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5aa0 50%, #1a3a5c 100%);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
}

.login-logo {
    text-align: center;
    margin-bottom: 12px;
}

.login-logo img {
    height: 52px;
    width: auto;
}

.login-card h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: .88rem;
    margin-bottom: 28px;
}

.login-card .noticeText {
    text-align: center;
    font-size: .95rem;
    font-weight: 600;
    color: #dc2626;
    margin-top: 2px;
}

.login-card .form-group { margin-bottom: 18px; }

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 6px;
}

.remember-group { margin-bottom: 8px; }
.remember-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    font-size: .88rem;
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.login-links a:hover { text-decoration: underline; }

/* ===== 密码输入框可见性切换 ===== */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border-radius: 6px;
    transition: color .15s, background .15s;
    padding: 0;
}

.password-toggle:hover {
    color: #475569;
    background: rgba(0,0,0,.04);
}

/* ===== 验证码发送 ===== */
.code-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.code-wrapper .form-control {
    flex: 1;
}

.btn-code {
    flex-shrink: 0;
    padding: 9px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.btn-code:hover { background: var(--primary-dark); }
.btn-code:disabled { background: #94a3b8; cursor: not-allowed; }

.password-toggle .eye-open { display: block; }
.password-toggle .eye-closed { display: none; }

.password-toggle.show .eye-open { display: none; }
.password-toggle.show .eye-closed { display: block; }

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== 供应商自动补全 ===== */
.supplier-wrapper {
    position: relative;
}

.supplier-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.supplier-suggestion {
    padding: 10px 14px;
    cursor: pointer;
    font-size: .88rem;
    color: var(--text);
    transition: background .1s;
}

.supplier-suggestion:hover {
    background: #f1f5f9;
}

.supplier-suggestion.new {
    color: var(--primary);
    font-weight: 500;
}

.supplier-suggestion.new:hover {
    background: #eff6ff;
}

/* ===== 响应式 ===== */
/* ---------- 平板 ---------- */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; height: 52px; }
    .navbar-brand { font-size: 1rem; }
    .navbar-nav .nav-link { padding: 6px 10px; font-size: .8rem; }
    .navbar-right { font-size: .75rem; gap: 6px; }
    .btn-logout { padding: 4px 10px; font-size: .78rem; }
    .user-menu-btn { font-size: .65rem; padding: 2px 5px; }
    .user-menu-dropdown { min-width: 85px; }
    .user-menu-item { padding: 4px 10px; font-size: .74rem; }

    .main-container { padding: 14px 10px; }

    .card { padding: 16px; }
    .card-header { flex-direction: column; align-items: flex-start; }

    /* 询价表 */
    .quote-head { padding: 16px 14px; }
    .quote-logo-area { gap: 10px; }
    .quote-logo-icon { width: 40px; height: 40px; font-size: .9rem; }
    .quote-title { font-size: 1.15rem; letter-spacing: 1px; }
    .quote-info-table { font-size: .78rem; }
    .info-label { width: 70px; font-size: .75rem; }
    .info-value { padding-right: 8px !important; }
    .info-input { font-size: .8rem; }

    .quote-table { font-size: .78rem; }
    .quote-table thead th { padding: 8px 6px; font-size: .72rem; }
    .quote-table tbody td { padding: 6px; }
    .prod-select { font-size: .76rem; padding: 6px 24px 6px 8px; }
    .qty-input { width: 48px; padding: 6px 4px; font-size: .8rem; }
    .spec-cell { font-size: .72rem; }
    .sub-cell { font-size: .8rem; }
    .cat-badge { font-size: .72rem; padding: 2px 8px; }

    .quote-actions { padding: 14px 0; gap: 8px; }
    .quote-notes { padding: 14px 14px 18px; }
    .quote-notes ol { font-size: .76rem; }

    /* 询价筛选表（quote-table-h）平板端 */
    .quote-simple-head { padding: 16px 14px; gap: 10px; }
    .quote-head-actions { gap: 6px; }
    .quote-count-tip { font-size: .78rem; }
    .quote-table-h { font-size: .76rem; width: 900px; min-width: auto; }
    .quote-table-h thead th { padding: 6px 4px; font-size: .7rem; }
    .quote-table-h tbody td { padding: 6px 4px; }
    .filter-select { padding: 5px 22px 5px 6px; font-size: .7rem; }

    /* 产品 */
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .product-card img { height: 140px; }

    .login-card { padding: 24px 18px; max-width: 380px; }

    .search-bar { flex-direction: column; }
    .search-bar .form-control { max-width: 100%; }

    table { font-size: .82rem; }
    table th, table td { padding: 8px 8px; }

    .modal { max-width: 420px; padding: 20px; }

    .summary-bar { flex-direction: column; text-align: center; padding: 16px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 480px) {
    /* 导航 — 精简文字 */
    .navbar { padding: 0 8px; height: 48px; }
    .navbar-brand { font-size: .92rem; }
    .navbar-nav { gap: 0; }
    .navbar-nav .nav-link { padding: 4px 8px; font-size: .74rem; }
    .navbar-right { font-size: .7rem; gap: 4px; }
    .btn-logout { padding: 3px 8px; font-size: .7rem; }
    .user-menu-btn { font-size: .6rem; padding: 1px 4px; }
    .user-menu-dropdown { min-width: 80px; }
    .user-menu-item { padding: 4px 8px; font-size: .68rem; }

    .main-container { padding: 10px 6px; }

    .card { padding: 12px; border-radius: 8px; }
    .card-header h2 { font-size: 1rem; }

    /* ===== 手机端询价表：表格 → 卡片列表 ===== */
    .quote-head { padding: 14px 10px; }
    .quote-logo-area { flex-direction: column; align-items: flex-start; gap: 4px; }
    .quote-title { font-size: 1.05rem; }
    .quote-subtitle { font-size: .74rem; }
    .quote-info-table,
    .quote-info-table tbody,
    .quote-info-table tr,
    .quote-info-table td { display: block; width: 100%; }
    .quote-info-table tr { margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
    .info-label { width: auto; min-width: 60px; font-size: .74rem; }
    .info-value { padding-right: 8px !important; }
    .info-input { font-size: .78rem; width: 100% !important; }

    /* 表头隐藏，用卡片布局 */
    .quote-table thead { display: none; }
    .quote-table,
    .quote-table tbody,
    .quote-table tfoot { display: block; }
    .quote-table tbody { display: flex; flex-direction: column; gap: 10px; }

    .quote-table .quote-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
        padding: 12px;
        background: #fff;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    .quote-table .quote-row td {
        display: block;
        padding: 0 !important;
        border: none !important;
    }

    /* 卡片内布局 */
    .quote-table .quote-row .cat-cell { width: auto; }
    .quote-table .quote-row .cat-badge { font-size: .75rem; }
    .quote-table .quote-row td:nth-child(2) { flex: 1; min-width: 0; }     /* 产品下拉 */
    .quote-table .quote-row td:nth-child(3) { width: auto; }                 /* 数量 */
    .quote-table .quote-row td:nth-child(4) { width: 100%; margin-top: 2px; } /* 参数 */
    .quote-table .quote-row td:nth-child(5) { width: auto; }                 /* 小计 */
    .quote-table .quote-row td:nth-child(6) { margin-left: auto; }           /* 删除按钮 */

    .prod-select { font-size: .78rem; padding: 8px 28px 8px 10px; min-width: 140px; }
    .qty-input { font-size: .85rem; padding: 8px 4px; }
    .sub-cell { font-size: .9rem; }
    .spec-cell { font-size: .74rem; color: #64748b; }

    .btn-icon-del { width: 34px; height: 34px; font-size: 1.3rem; }

    /* 合计行 */
    .total-row { display: flex; justify-content: flex-end; align-items: center; padding: 14px 12px; }
    .total-row td { display: block; padding: 0 !important; }
    .total-row td:first-child { font-size: .9rem; margin-right: 8px; }
    .total-num { font-size: 1.15rem; }

    .quote-actions { padding: 12px 0; }
    .quote-actions .btn { flex: 1; text-align: center; padding: 12px; font-size: .9rem; }
    .quote-notes { padding: 12px 10px 16px; }
    .quote-notes .notes-title { font-size: .82rem; }
    .quote-notes ol { font-size: .74rem; line-height: 1.7; padding-left: 16px; }

    /* ===== 询价筛选表 手机端：流畅横向滚动 ===== */
    .quote-simple-head {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 10px;
        gap: 8px;
    }
    .quote-head-actions { width: 100%; justify-content: space-between; }
    .quote-count-tip { font-size: .76rem; margin-right: 0; }

    .quote-table-wrap {
        margin: 0;
        border: none;
        border-radius: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* 右侧渐变阴影提示可滑动 */
        background:
            linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left,
            linear-gradient(to right, rgba(255,255,255,0), #fff 70%) right;
        background-repeat: no-repeat;
        background-size: 40px 100%, 40px 100%;
        background-attachment: local, scroll;
    }
    .quote-table-h { width: 900px; min-width: auto; font-size: .76rem; }
    .quote-table-h thead th {
        padding: 6px 4px;
        font-size: .68rem;
    }
    .quote-table-h tbody td {
        padding: 6px 4px;
        font-size: .74rem;
    }
    .quote-table-h .empty-row td { padding: 24px 6px !important; }
    .filter-select { font-size: .7rem; padding: 5px 20px 5px 5px; }

    /* 产品卡片 */
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .product-card img { height: 110px; }
    .product-card .p-info { padding: 8px 10px; }
    .product-card .p-name { font-size: .82rem; }
    .product-card .p-price { font-size: .9rem; }
    .product-card .p-actions { padding: 0 10px 10px; flex-wrap: wrap; }
    .product-card .p-actions .btn { flex: 1; min-width: 60px; text-align: center; }

    /* 表格 */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { font-size: .78rem; white-space: nowrap; }
    table th, table td { padding: 8px 6px; }

    /* 登录页 */
    .login-page { padding: 12px; align-items: flex-start; padding-top: 60px; }
    .login-card { padding: 22px 16px; border-radius: 12px; max-width: 100%; }
    .login-card h2 { font-size: 1.2rem; }
    .login-card .subtitle { font-size: .8rem; margin-bottom: 20px; }
    .login-card .btn-primary { padding: 13px; font-size: 1rem; }

    /* 输入框放大触摸目标 */
    .form-control { padding: 11px 12px; font-size: 1rem; }  /* 防止 iOS 缩放 */
    select.form-control { padding-right: 32px; background-size: 16px; }
    textarea.form-control { font-size: 1rem; }

    /* 弹窗 */
    .modal { max-width: 95vw; padding: 18px; border-radius: 10px; }
    .modal h3 { font-size: 1rem; margin-bottom: 14px; }
    .modal-actions { gap: 8px; }
    .modal-actions .btn { flex: 1; text-align: center; padding: 11px; }

    /* 按钮放大 */
    .btn { padding: 10px 16px; font-size: .88rem; min-height: 42px; align-items: center; justify-content: center; }
    .btn-sm { padding: 7px 12px; font-size: .8rem; min-height: 34px; }

    /* Toast */
    .toast { top: 60px; right: 8px; left: 8px; text-align: center; font-size: .82rem; padding: 12px 16px; }
}

/* 桌面端恢复 sticky 表头（移动端 sticky 会导致列错位） */
@media (min-width: 769px) {
    .quote-table-h thead th {
        position: sticky;
        top: 0;
    }
}

/* ===== 个人信息页 ===== */
.profile-info {
    padding: 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-row {
    font-size: .92rem;
    color: var(--text);
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-label {
    display: inline-block;
    width: 90px;
    color: var(--text-secondary);
    font-weight: 500;
}
.invite-section { margin-top: 8px; }
.invite-tip {
    font-size: .8rem;
    color: var(--text-secondary);
    margin: 8px 0 12px;
    background: #f8fafc;
    border-left: 3px solid var(--primary);
    padding: 8px 12px;
    border-radius: 4px;
}
.invite-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.invite-code-label {
    color: var(--text-secondary);
    font-size: .88rem;
}
.invite-code-box code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 1px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    word-break: break-all;
}
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.6;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #e2e8f0; color: #64748b; }

/* 注册弹窗中的角色提示 */
.register-role-tip {
    font-size: .78rem;
    color: var(--text-secondary);
    margin: 4px 0 12px;
    padding: 6px 10px;
    background: #fff7ed;
    border-left: 3px solid var(--warning);
    border-radius: 4px;
}

/* 注册弹窗中的 logo */
#registerModal .login-logo {
    text-align: center;
}
#registerModal .login-logo img {
    height: 56px;
    width: auto;
}

/* ===== 分页控件 ===== */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.pagination-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination-summary {
    font-size: .8rem;
    color: var(--text-secondary);
    user-select: none;
    letter-spacing: .4px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(148, 163, 184, .08);
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, .1);
    border: 1.5px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    user-select: none;
    white-space: nowrap;
    position: relative;
}
.page-btn:hover {
    color: var(--primary);
    background: rgba(79, 110, 246, .1);
    border-color: rgba(79, 110, 246, .25);
    transform: translateY(-1px);
}
.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
    cursor: default;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(79, 110, 246, .35);
    transform: translateY(-1px);
}
.page-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 110, 246, .42);
}
.page-btn.page-nav {
    padding: 0 16px;
    min-width: auto;
    font-weight: 600;
    font-size: .86rem;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
}
.page-btn.page-nav::before,
.page-btn.page-nav::after {
    display: inline-block;
    color: currentColor;
    font-size: .9rem;
    transition: transform .22s ease;
}
.page-btn.page-nav.prev::before { content: '\2039'; margin-right: 6px; }
.page-btn.page-nav.next::after  { content: '\203A'; margin-left: 6px; }
.page-btn.page-nav.prev:hover::before { transform: translateX(-2px); }
.page-btn.page-nav.next:hover::after  { transform: translateX(2px); }
.page-btn.page-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f5f7ff;
    box-shadow: 0 3px 10px rgba(79, 110, 246, .14);
}
.page-btn.disabled {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .06);
    border-color: transparent;
    cursor: not-allowed;
    pointer-events: none;
}
.page-btn.disabled.page-nav {
    color: #cbd5e1;
    background: #fafbfc;
    border-color: #eef2f7;
}
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 38px;
    color: #a0aab8;
    font-size: .9rem;
    letter-spacing: 2px;
    user-select: none;
}
@media (max-width: 768px) {
    .pagination-btns { gap: 4px; }
    .page-btn { min-width: 32px; height: 32px; padding: 0 8px; font-size: .8rem; border-radius: 8px; }
    .page-btn.page-nav { padding: 0 12px; font-size: .78rem; }
    .page-ellipsis { width: 24px; height: 32px; }
    .pagination-summary { font-size: .76rem; padding: 3px 10px; }
}
@media (max-width: 480px) {
    .page-btn { min-width: 28px; height: 28px; font-size: .76rem; border-radius: 6px; }
    .page-btn.page-nav { padding: 0 10px; font-size: .74rem; }
    .page-ellipsis { width: 20px; height: 28px; }
}

/* ===== 备案信息 ===== */
.site-footer {
    text-align: center;
    padding: 18px 20px 24px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--primary);
}
.login-page .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    color: rgba(255,255,255,.75);
}
.login-page .site-footer a {
    color: rgba(255,255,255,.75);
}
.login-page .site-footer a:hover {
    color: #fff;
}
