/* 智研云·经销 SaaS H5 样式 V0.1
   配色：沿用智研云主项目（医疗级、商务蓝 #1e40af）
   作者: AI 秘书 | 2026-09-04 Day 1
*/

:root {
  --color-primary: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e3a8a;
  --color-bg: #f5f7fa;
  --color-card: #ffffff;
  --color-text: #1f2937;
  --color-text-2: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-gray: #9ca3af;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  padding-bottom: 60px;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.topbar-user { font-weight: 600; color: var(--color-primary); }
.topbar-dealer { color: var(--color-text-2); flex: 1; text-align: center; }
.topbar-logout { color: var(--color-danger); text-decoration: none; }

/* 主标题 */
.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* 卡片 */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--color-text-2); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.form-input:focus { border-color: var(--color-primary); }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { background: var(--color-gray); cursor: not-allowed; }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }

/* Tab 切换 */
.tab-bar {
  display: flex;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}
.tab-item {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text-2);
  transition: all 0.2s;
}
.tab-item.active {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.badge-灰, .badge-gray { background: #f3f4f6; color: var(--color-text-2); }
.badge-蓝, .badge-blue { background: #dbeafe; color: var(--color-primary); }
.badge-橙, .badge-orange { background: #fed7aa; color: #c2410c; }
.badge-绿, .badge-green { background: #d1fae5; color: #047857; }
.badge-红, .badge-red { background: #fee2e2; color: var(--color-danger); }

/* 订单卡片 */
.order-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.05s;
}
.order-card:active { transform: scale(0.98); }
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-card-no { font-weight: 600; color: var(--color-primary); font-size: 13px; }
.order-card-title { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.order-card-meta { font-size: 12px; color: var(--color-text-2); margin-bottom: 2px; }
.order-card-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 12px;
  color: var(--color-text-2);
  display: flex;
  justify-content: space-between;
}

/* 浮动按钮 */
.fab {
  position: fixed;
  right: max(16px, calc(50vw - 240px + 16px));
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
  cursor: pointer;
  text-decoration: none;
  border: none;
}

/* 加载/空 */
.empty {
  text-align: center;
  color: var(--color-text-2);
  padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 13px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
}
.toast-error { background: var(--color-danger); }
.toast-success { background: var(--color-success); }
.toast-warning { background: var(--color-warning); }

/* 底部链接 */
.bottom-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-2);
}
.bottom-links a {
  color: var(--color-primary);
  text-decoration: none;
  margin: 0 8px;
}

/* 详情块 */
.detail-section { margin-bottom: 16px; }
.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.detail-row-label { color: var(--color-text-2); }
.detail-row-value { color: var(--color-text); font-weight: 500; text-align: right; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}
.timeline-item {
  position: relative;
  padding-bottom: 12px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-success);
}