/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', Arial, sans-serif; background: #f5f7fa; color: #333; line-height: 1.6; }
[v-cloak] { display: none; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: 'Courier New', monospace; font-size: 13px; }
.text-danger { color: #dc2626; }
.text-bold { font-weight: bold; }
.text-primary { color: #2563eb; }
.hint { color: #888; font-size: 14px; margin: 8px 0; }
.success-msg { color: #16a34a; padding: 8px; margin: 8px 0; }
.error-msg { color: #dc2626; padding: 8px; margin: 8px 0; }
.error-card { border-color: #fecaca !important; background: #fef2f2 !important; }

/* ===== 头部 ===== */
.header { background: #1e293b; color: #fff; padding: 0 20px; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo { font-size: 18px; font-weight: bold; }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { color: #94a3b8; font-size: 15px; }
.nav a:hover, .nav a.active { color: #fff; }
.user-info { color: #94a3b8; font-size: 14px; }
.user-info a { color: #6ea8fe; margin-left: 8px; }

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.card h2 { font-size: 20px; margin-bottom: 16px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h2 { margin-bottom: 0; }

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1e293b; }
.login-card { background: #fff; padding: 40px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 8px; }
.login-subtitle { text-align: center; color: #888; margin-bottom: 24px; }

/* ===== 表单 ===== */
.form { max-width: 500px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #2563eb; }
.form-group input:disabled { background: #f3f4f6; color: #6b7280; }
.form-row { display: flex; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .form-row-2, .form-row-3, .form-grid { grid-template-columns: 1fr; } }
.input-large { flex: 1; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 16px; }
.input-search { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; margin-right: 8px; }

/* ===== 按钮 ===== */
.btn-primary, .btn-secondary { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: opacity 0.2s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; background: #f9fafb; color: #6b7280; font-weight: 600; border-bottom: 2px solid #e5e7eb; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.table tr:hover { background: #f9fafb; }
.track-table input { border: 1px solid #e5e7eb; padding: 6px 8px; border-radius: 4px; font-size: 13px; width: 100%; }
.track-table input:focus { border-color: #2563eb; outline: none; }
.track-table .row-empty { background: #fffbeb; }
.track-table .row-filled { background: #f0fdf4; }
.track-table .row-auto { background: #eff6ff; }
.track-table th[style*="160px"] { color: #2563eb; }

/* ===== 信息网格 ===== */
.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.info-grid > div { padding: 12px; background: #f9fafb; border-radius: 6px; }
.info-grid label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.info-grid span { font-size: 14px; font-weight: 500; }
@media (max-width: 768px) { .info-grid { grid-template-columns: 1fr; } }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.stat-num { font-size: 28px; font-weight: bold; color: #2563eb; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: #e5e7eb; }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-dot { position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #d1d5db; border: 2px solid #fff; box-shadow: 0 0 0 2px #e5e7eb; }
.timeline-dot.active { background: #2563eb; box-shadow: 0 0 0 2px #93c5fd; }
.timeline-content { background: #f9fafb; padding: 12px 16px; border-radius: 6px; }
.timeline-date { font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.timeline-status { font-size: 15px; font-weight: 500; }
.timeline-desc { font-size: 13px; color: #555; margin-top: 4px; }
.timeline-desc-ru { font-size: 13px; color: #888; margin-top: 2px; }

/* ===== 其他 ===== */
.add-user-form { background: #f9fafb; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.total-freight-box { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 16px 20px; margin: 16px 0; }
.total-freight-box .total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #475569; border-bottom: 1px dashed #e0f2fe; }
.total-freight-box .total-final { font-size: 18px; font-weight: bold; color: #2563eb; border-bottom: none; border-top: 2px solid #2563eb; padding-top: 12px; margin-top: 4px; }
.empty { text-align: center; padding: 40px; color: #9ca3af; font-size: 15px; }
.footer { text-align: center; padding: 20px; color: #9ca3af; font-size: 13px; }

/* ===== 账单汇总 ===== */
.bill-summary { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin: 20px 0; }
.bill-summary h3 { font-size: 16px; margin-bottom: 12px; color: #1e293b; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bill-table th { text-align: left; padding: 8px 12px; background: #f1f5f9; color: #64748b; font-weight: 600; border-bottom: 2px solid #e2e8f0; }
.bill-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; }
.bill-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bill-table .bill-total td { font-size: 16px; font-weight: bold; color: #2563eb; border-top: 2px solid #2563eb; border-bottom: none; padding-top: 12px; }
.bill-table .bill-usd td { color: #64748b; font-size: 13px; border-bottom: none; }

/* ===== 支付状态 ===== */
.payment-status-box { display: flex; justify-content: space-between; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px 20px; margin: 16px 0; }
.payment-status-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.payment-label { font-size: 14px; font-weight: 500; color: #92400e; }
.payment-date { font-size: 13px; color: #a16207; }
.payment-status-right { display: flex; gap: 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }

.btn-success { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; background: #16a34a; color: #fff; transition: background 0.2s; }
.btn-success:hover { background: #15803d; }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 货物图片 ===== */
.images-section { margin-top: 20px; }
.images-section h3 { font-size: 16px; margin-bottom: 12px; color: #1e293b; }
.images-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.images-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; }
.images-card h4 { font-size: 14px; margin-bottom: 12px; color: #475569; }
.image-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.image-item { position: relative; width: 100%; padding-top: 100%; border-radius: 6px; overflow: hidden; background: #e2e8f0; cursor: pointer; }
.image-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.image-item:hover img { transform: scale(1.05); transition: transform 0.2s; }
.image-delete { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(239, 68, 68, 0.9); color: #fff; border: none; cursor: pointer; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; z-index: 2; }
.image-delete:hover { background: #dc2626; }
.image-upload-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding-top: 100%; border: 2px dashed #cbd5e1; border-radius: 6px; cursor: pointer; color: #64748b; font-size: 13px; background: #fff; position: relative; transition: all 0.2s; }
.image-upload-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.image-upload-btn span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* 图片预览 */
.image-preview-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center; z-index: 9999; cursor: zoom-out; }
.image-preview-mask img { max-width: 90%; max-height: 90%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

@media (max-width: 768px) {
    .images-row { grid-template-columns: 1fr; }
    .image-grid { grid-template-columns: repeat(3, 1fr); }
    .header-inner { flex-direction: column; height: auto; padding: 10px 0; gap: 8px; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 6px 8px; }
    .payment-status-box { flex-direction: column; gap: 12px; }
    .payment-status-right { width: 100%; }
}
