* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
}

body {
  padding-bottom: 56px; /* 给底部 tab 留空间 */
  max-width: 480px;
  margin: 0 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* ============ 顶部标题栏 ============ */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1677ff;
  color: #fff;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
}

.user-info {
  font-size: 12px;
  opacity: 0.95;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ 视图容器 ============ */
.view-root {
  padding: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ============ 日期选择 ============ */
.date-picker-wrap {
  margin: -12px -12px 12px;
  padding: 12px;
  background: #fff;
}

.date-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.date-option {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f5f5;
  text-align: center;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.date-option.selected {
  background: #1677ff;
  color: #fff;
  font-weight: 600;
}

/* ============ 班车卡片 ============ */
.route-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.route-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.route-name {
  font-size: 15px;
  font-weight: 600;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.tag-blue { background: #e6f4ff; color: #1677ff; }
.tag-orange { background: #fff7e6; color: #fa8c16; }
.tag-red { background: #fff1f0; color: #ff4d4f; }
.tag-gray { background: #f5f5f5; color: #999; }

.route-stops {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555;
  font-size: 13px;
  margin-bottom: 8px;
}

.dot-start, .dot-end {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1677ff;
}

.dot-end {
  background: #52c41a;
}

.arrow {
  color: #999;
}

.departure-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0;
}

.departure-time {
  font-size: 22px;
  font-weight: 700;
}

.departure-note {
  font-size: 13px;
  color: #666;
}

.capacity-info {
  font-size: 12px;
  color: #666;
  margin: 4px 0;
}

.capacity-info.open-hint {
  color: #fa8c16;
}

.capacity-bar {
  height: 6px;
  border-radius: 3px;
  background: #f0f0f0;
  overflow: hidden;
  margin: 6px 0 10px;
}

.capacity-fill {
  height: 100%;
  border-radius: 3px;
}

.capacity-fill.low { background: #52c41a; }
.capacity-fill.medium { background: #faad14; }
.capacity-fill.high { background: #ff4d4f; }

.action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.reserve-btn {
  padding: 8px 20px;
  border-radius: 18px;
  font-size: 14px;
}

.reserve-btn.active {
  background: #1677ff;
  color: #fff;
}

.reserve-btn.disabled {
  background: #f5f5f5;
  color: #999;
}

.reserve-btn.full {
  background: #fff1f0;
  color: #ff4d4f;
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 60px 0;
}

/* ============ 我的预约 ============ */
.mine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mine-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mine-item .mine-date {
  font-size: 13px;
  color: #999;
  margin-bottom: 6px;
}

.mine-item .mine-route {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mine-item .mine-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
}

.cancel-btn {
  padding: 6px 14px;
  border-radius: 14px;
  background: #fff1f0;
  color: #ff4d4f;
  font-size: 13px;
}

/* ============ 管理后台 ============ */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 8px;
}

.admin-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-item {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.summary-item .num {
  font-size: 20px;
  font-weight: 700;
  color: #1677ff;
}

.summary-item .label {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.admin-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.admin-card .admin-line {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-card .admin-meta {
  font-size: 12px;
  color: #999;
  margin: 6px 0 8px;
}

.badge-adjusted {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #fa8c16;
  font-size: 11px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th, .admin-table td {
  border: 1px solid #eee;
  padding: 6px 4px;
  text-align: left;
}

.admin-table th {
  background: #fafafa;
  font-weight: 600;
}

.btn {
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.btn-primary { background: #1677ff; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #1677ff; color: #1677ff; }
.btn-danger { background: #fff1f0; color: #ff4d4f; }
.btn-gray { background: #f5f5f5; color: #666; }

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.form-row label {
  flex: 0 0 60px;
  font-size: 13px;
  color: #666;
}

.form-row input, .form-row select {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-mask.show { display: flex; }

.modal {
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* ============ 底部 tab ============ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 20;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  color: #999;
  text-decoration: none;
  font-size: 11px;
}

.tab-item .tab-icon {
  font-size: 18px;
  line-height: 1;
}

.tab-item.active {
  color: #1677ff;
  font-weight: 600;
}

/* ============ toast / loading ============ */
.toast {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 13px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  text-align: center;
}

.toast.show { opacity: 1; }

.loading-mask {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  color: #1677ff;
  font-size: 14px;
  z-index: 55;
}
