/* 联凯跨境业务跟单系统 - H5移动端样式 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary); }
img { max-width: 100%; display: block; }

/* 页面容器 */
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 60px; }

/* 顶部导航 */
.navbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.navbar .nav-title { font-size: 17px; font-weight: 600; }
.navbar .nav-back { font-size: 24px; cursor: pointer; width: 32px; }
.navbar .nav-right { font-size: 14px; opacity: 0.9; }

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 12px 16px;
  overflow: hidden;
}
.card-body { padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.form-label .req { color: var(--danger); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: #fff;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* 兜底：卡片、弹窗、详情区内的裸 input / select 自动美化 */
.card input[type="text"],
.card input[type="password"],
.card input[type="email"],
.card input[type="number"],
.card input[type="tel"],
.card input[type="url"],
.card select,
.card textarea,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group select,
.form-group textarea,
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="email"],
.modal-body input[type="number"],
.modal-body input[type="tel"],
.modal-body input[type="url"],
.modal-body select,
.modal-body textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: #fff;
  transition: border-color 0.2s; box-sizing: border-box;
}
.card input:focus,
.card select:focus,
.card textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.card select,
.form-group select,
.modal-body select {
  appearance: auto; -webkit-appearance: auto; cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 状态标签 */
.status-tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.status-pending_pricing { background: #fef3c7; color: #92400e; }
.status-pricing_draft { background: #e0e7ff; color: #3730a3; }
.status-pending_review { background: #dbeafe; color: #1e40af; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-procurement { background: #fce7f3; color: #9d174d; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* 列表项 */
.list-item {
  background: #fff; border-radius: var(--radius); margin: 10px 16px;
  padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: box-shadow 0.2s;
}
.list-item:active { box-shadow: var(--shadow-lg); }
.list-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.list-item-title { font-size: 15px; font-weight: 600; flex: 1; }
.list-item-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }
.list-item-meta span { display: inline-flex; align-items: center; gap: 2px; }
.list-item-price { font-size: 16px; font-weight: 700; color: var(--danger); }

/* 底部TabBar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 0;
  z-index: 100; box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.tabbar-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 12px; cursor: pointer; color: var(--text-light); }
.tabbar-item.active { color: var(--primary); }
.tabbar-item .icon { font-size: 22px; }
.tabbar-item .text { font-size: 11px; }

/* 图片上传 */
.upload-area { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-item { position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .remove { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: #fff; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.upload-btn { width: 80px; height: 80px; border: 2px dashed var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-lighter); cursor: pointer; }
.upload-btn .plus { font-size: 28px; }
.upload-btn .text { font-size: 11px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.stat-card.blue .num { color: var(--primary); }
.stat-card.green .num { color: var(--success); }
.stat-card.orange .num { color: var(--warning); }
.stat-card.purple .num { color: #7c3aed; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-lighter); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }

/* Loading */
.loading { text-align: center; padding: 20px; color: var(--text-light); }
.loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 登录页 */
.login-page { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 20px; }
.login-logo { text-align: center; margin-bottom: 30px; color: #fff; }
.login-logo .icon { font-size: 56px; }
.login-logo .title { font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-logo .subtitle { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.login-form { background: #fff; border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow-lg); }
.login-form .form-group { margin-bottom: 18px; }

/* 详情页 */
.detail-section { background: #fff; margin: 10px 16px; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.detail-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.detail-row .label { color: var(--text-light); flex-shrink: 0; width: 90px; }
.detail-row .value { text-align: right; flex: 1; word-break: break-all; }
.detail-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.detail-images img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }

/* 时间线 */
.timeline { padding: 0 4px; }
.timeline-item { position: relative; padding-left: 24px; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item .dot { position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary); }
.timeline-item .dot.done { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item .time { font-size: 12px; color: var(--text-light); }
.timeline-item .content { font-size: 14px; margin-top: 2px; }

/* 浮动按钮 */
.fab { position: fixed; right: 20px; bottom: 70px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 4px 12px rgba(37,99,235,0.4); cursor: pointer; z-index: 50; border: none; }

/* 搜索栏 */
.search-bar { padding: 10px 16px; }
.search-bar input { width: 100%; padding: 10px 16px 10px 36px; border: 1px solid var(--border); border-radius: 20px; font-size: 14px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat; }

/* 筛选标签 */
.filter-tabs { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; white-space: nowrap; }
.filter-tab { padding: 4px 14px; border-radius: 20px; font-size: 13px; background: #fff; color: var(--text-light); border: 1px solid var(--border); cursor: pointer; }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 360px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.modal-footer .btn { flex: 1; }
