/* ====================================================
   杉泰福 · 客户中心 v1.0
   配色：与 app.html 一致，主蓝 #0066cc，强调橙 #ff8800
   ==================================================== */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    margin: 0;
    background: #f5f7fa;
    color: #1f2937;
}

/* ============ 顶部导航（复用 index.html 风格） ============ */
.nav { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 8px; }
.logo-img { height: 32px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { color: #4b5563; text-decoration: none; padding: 8px 14px; font-size: 14px; border-radius: 6px; transition: all 0.15s; }
.nav-links a:hover { background: #f3f4f6; color: #0066cc; }
.nav-links a.nav-cta { color: #0066cc; font-weight: 500; }
.nav-links a.nav-cta.active { background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%); color: #fff; }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
}

/* ============ 登录层 ============ */
.login-overlay { position: fixed; inset: 0; background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%); display: flex; align-items: center; justify-content: center; z-index: 999; }
.login-card { background: #fff; border-radius: 12px; padding: 36px; width: 380px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.logo-icon { width: 56px; height: 56px; background: linear-gradient(135deg, #0066cc, #0052a3); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.logo-icon svg { width: 32px; height: 32px; fill: #fff; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.login-card p { margin: 0 0 20px; color: #6b7280; font-size: 13px; text-align: center; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; outline: none; transition: border 0.15s; }
.login-card input:focus { border-color: #0066cc; }
.login-btn { width: 100%; padding: 12px; margin-top: 12px; background: linear-gradient(135deg, #0066cc, #0052a3); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,102,204,0.3); }
.login-msg { margin-top: 12px; font-size: 13px; text-align: center; min-height: 20px; }
.login-msg.error { color: #ef4444; }
.login-msg.success { color: #10b981; }
.login-tips code { display: inline-block; padding: 2px 6px; background: #e0e7ff; color: #0066cc; border-radius: 3px; font-size: 11px; margin: 2px 4px 2px 0; }
.login-tips code:hover { background: #c7d2fe; }

/* ============ 主应用壳 ============ */
.cust-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.brand-dot { width: 28px; height: 28px; background: linear-gradient(135deg, #0066cc, #0052a3); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.brand-dot svg { width: 18px; height: 18px; fill: #fff; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { color: #6b7280; font-size: 13px; }
.topbar-btn { padding: 6px 14px; background: #f3f4f6; color: #4b5563; border: none; border-radius: 5px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.topbar-btn:hover { background: #e5e7eb; }
.topbar-btn.logout { color: #ef4444; }
.topbar-btn.logout:hover { background: #fee2e2; }

/* ============ Tab 栏 ============ */
.tabbar { background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; padding: 0 20px; flex-shrink: 0; overflow-x: auto; }
.tab-item { padding: 14px 20px; cursor: pointer; color: #6b7280; font-size: 14px; border-bottom: 2px solid transparent; transition: all 0.15s; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab-item:hover { color: #0066cc; }
.tab-item.active { color: #0066cc; border-bottom-color: #0066cc; font-weight: 500; }
.tab-icon { font-size: 16px; }

/* ============ 页面容器 ============ */
.cust-body { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
.cust-page { display: none; }
.cust-page.active { display: block; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { margin: 0; font-size: 20px; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.search-input { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px; outline: none; min-width: 220px; }
.search-input:focus { border-color: #0066cc; }
.filter-select { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px; outline: none; background: #fff; cursor: pointer; }

.btn { padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: linear-gradient(135deg, #0066cc, #0052a3); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,204,0.25); }
.btn-secondary { background: #f3f4f6; color: #4b5563; }
.btn-secondary:hover { background: #e5e7eb; }

/* ============ 统计卡片 ============ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; padding: 16px 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.stat-label { font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 600; color: #1f2937; }

/* ============ 表格 ============ */
.table-wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #f9fafb; padding: 12px 16px; text-align: left; font-weight: 500; color: #6b7280; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #1f2937; }
.data-table tr:hover td { background: #f9fafb; }
.data-table tr:last-child td { border-bottom: none; }

.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-已下单, .status-已入库 { background: #e0e7ff; color: #4338ca; }
.status-运输中 { background: #fef3c7; color: #b45309; }
.status-已签收 { background: #d1fae5; color: #047857; }
.status-已收款 { background: #d1fae5; color: #047857; }
.status-未收款 { background: #fee2e2; color: #b91c1c; }

.empty-state { padding: 60px 20px; text-align: center; color: #9ca3af; font-size: 14px; }

/* ============ 运单追踪 ============ */
.trk-result { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.trk-header { padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.trk-no { font-size: 20px; font-weight: 600; color: #0066cc; margin-bottom: 6px; }
.trk-meta { color: #6b7280; font-size: 13px; margin-bottom: 8px; }
.trk-timeline { position: relative; padding-left: 24px; }
.trk-timeline::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: #e5e7eb; }
.trk-step { position: relative; padding-bottom: 24px; }
.trk-step:last-child { padding-bottom: 0; }
.trk-dot { position: absolute; left: -22px; top: 4px; width: 16px; height: 16px; background: #fff; border: 3px solid #d1d5db; border-radius: 50%; z-index: 1; }
.trk-step.done .trk-dot { background: #0066cc; border-color: #0066cc; box-shadow: 0 0 0 4px rgba(0,102,204,0.15); }
.trk-step:not(.done) .trk-content { opacity: 0.5; }
.trk-time { font-size: 12px; color: #9ca3af; margin-bottom: 2px; }
.trk-loc { font-size: 14px; font-weight: 500; color: #1f2937; margin-bottom: 2px; }
.trk-desc { font-size: 13px; color: #6b7280; }

/* ============ 地址簿卡片 ============ */
.addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.addr-card { background: #fff; border-radius: 8px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid #e5e7eb; transition: all 0.15s; }
.addr-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #0066cc; }
.addr-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.addr-card-header strong { font-size: 15px; }
.addr-card-line { font-size: 13px; color: #4b5563; line-height: 1.8; word-break: break-all; }

/* ============ Modal ============ */
.stf-modal-box { background: #fff; border-radius: 10px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.stf-modal-header { padding: 16px 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.stf-modal-title { font-size: 16px; font-weight: 600; }
.stf-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #9ca3af; padding: 0; width: 28px; height: 28px; }
.stf-modal-close:hover { color: #1f2937; }
.stf-modal-body { padding: 20px; }
.stf-modal-footer { padding: 12px 20px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; font-weight: 500; }
.form-row input, .form-row textarea { width: 100%; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; outline: none; font-family: inherit; }
.form-row input:focus, .form-row textarea:focus { border-color: #0066cc; }
