:root {
  --primary-color: #f97316; /* Orange for accents */
  --bg-color: #F7F8FA; /* very light grey */
  --card-bg: #FFFFFF;
  --text-main: #111827; /* almost black */
  --text-muted: #6B7280; /* lighter gray */
  --border-color: #E5E7EB;
  --success: #0bb17d; /* fresh green from screenshot */
  --danger: #eb453e; /* fresh red from screenshot */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}

input {
  font-family: inherit;
}

/* Header */
.header {
  background-color: #FFFFFF;
  color: var(--text-main);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 56px;
  z-index: 10;
}

.header.border-b {
  border-bottom: 1px solid var(--border-color);
}

.header .back-btn {
  position: absolute;
  left: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.header h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Button */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Base Card */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

/* Tabs */
.tabs {
  display: flex;
  background: white;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  gap: 20px;
}
.tab {
  padding: 14px 0;
  font-size: 16px;
  color: var(--text-muted);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}
.tab.active {
  color: var(--text-main);
  font-weight: bold;
  font-size: 18px;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #ff9a44, #fc6076);
  border-radius: 4px;
  z-index: -1;
  opacity: 0.8;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0,0,0,0.03);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #9CA3AF;
  font-size: 12px;
  gap: 4px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-item.active {
  color: var(--success);
}
.nav-item svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.nav-item.active svg {
  stroke: currentColor;
  stroke-width: 2.5;
}

.page-with-nav {
  padding-bottom: 80px; 
}

/* Typography & margin Helpers */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* =========================================
   报告标签与车架号 (全局)
========================================== */
.report-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tag-lemon {
  background-color: #FEF9C3;
  color: #A16207; 
  border: 1px solid #FEF08A;
}
.tag-alliance {
  background-color: #E0E7FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}
.record-vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* =========================================
   主功能分类 Tabs (报告筛选专用)
========================================== */
.type-tabs {
  display: flex;
  padding: 12px 16px 8px;
  gap: 10px;
  background: white;
  border-bottom: 1px solid var(--border-color);
}
.type-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--bg-color);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.type-tab.active {
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-color);
  border-color: rgba(249, 115, 22, 0.2);
  font-weight: 600;
}
