/* ==========================================================
   DrivePlan 主题(ElementAdmin 风格)
   ========================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #303133;
  font-size: 14px;
  background: #f0f2f5;
}

/* ===== 布局 ===== */
.dp-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ===== Header ===== */
.dp-header {
  grid-column: 1 / -1;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
  z-index: 10;
}
.dp-header__left { display: flex; align-items: center; gap: 12px; }
.dp-logo { font-size: 22px; }
.dp-title { font-size: 18px; font-weight: 600; color: #303133; }
.dp-subtitle { font-size: 13px; color: #909399; border-left: 1px solid #dcdfe6; padding-left: 12px; }
.dp-header__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.dp-user {
  width: 36px; height: 36px; border-radius: 50%;
  background: #409EFF; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; cursor: pointer;
}

/* ===== Sidebar ===== */
.dp-sidebar {
  background: #304156;
  overflow-y: auto;
}
.dp-menu { display: flex; flex-direction: column; padding: 8px 0; }
.dp-menu__item {
  color: #bfcbd9;
  padding: 12px 20px;
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.dp-menu__item:hover { background: #263445; color: #fff; }
.dp-menu__item.is-active {
  background: #263445;
  color: #409EFF;
  border-left-color: #409EFF;
}
.dp-menu__icon { font-size: 16px; }

/* ===== Main ===== */
.dp-main {
  background: #f0f2f5;
  overflow: hidden;
}

/* ===== Card ===== */
.dp-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
  padding: 16px 18px;
}
.dp-mt { margin-top: 14px; }
.dp-card__head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ebeef5;
}
.dp-card__title { font-size: 15px; font-weight: 600; color: #303133; }
.dp-card__sub { font-size: 12px; color: #909399; }

/* ===== Button ===== */
.dp-btn {
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.dp-btn:hover { color: #409EFF; border-color: #c6e2ff; background: #ecf5ff; }
.dp-btn:active { transform: translateY(1px); }
.dp-btn:disabled { opacity: .5; cursor: not-allowed; }
.dp-btn--primary { background: #409EFF; color: #fff; border-color: #409EFF; }
.dp-btn--primary:hover { background: #66b1ff; color: #fff; border-color: #66b1ff; }
.dp-btn--danger { color: #f56c6c; border-color: #fbc4c4; }
.dp-btn--danger:hover { color: #fff; background: #f56c6c; border-color: #f56c6c; }
.dp-btn--sm { padding: 4px 10px; font-size: 12px; }
.dp-btn--text { border: none; background: transparent; padding: 4px 8px; color: #409EFF; }
.dp-btn--text:hover { background: #ecf5ff; color: #409EFF; }

/* ===== Input ===== */
.dp-input {
  padding: 0 12px;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: #303133;
  width: 100%;
  transition: border-color .15s;
}
.dp-input:focus { border-color: #409EFF; }
.dp-input:disabled { background: #f5f7fa; color: #909399; cursor: not-allowed; }
.dp-input.is-error { border-color: #f56c6c; }
.dp-input.is-loading { background: #f5f7fa; }

/* ===== Tag ===== */
.dp-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 3px;
  font-size: 12px; line-height: 18px;
  background: #ecf5ff; color: #409EFF; border: 1px solid #d9ecff;
}
.dp-tag--warn { background: #fdf6ec; color: #e6a23c; border-color: #faecd8; }
.dp-tag--danger { background: #fef0f0; color: #f56c6c; border-color: #fde2e2; }
.dp-tag--success { background: #f0f9eb; color: #67c23a; border-color: #e1f3d8; }

/* ===== Toast ===== */
.dp-toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%);
  background: rgba(50, 50, 50, .9);
  color: #fff;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, top .2s;
  z-index: 9999;
  max-width: 80%;
}
.dp-toast.is-show { opacity: 1; }
.dp-toast--err { background: rgba(245, 108, 108, .9); }

/* ==========================================================
   首页 Index
   ========================================================== */
.dp-index {
  display: grid;
  grid-template-columns: 2fr 1fr;   /* 地图 2/3 + 面板 1/3 */
  height: 100%;
  gap: 1px;
  background: #ebeef5;
}
.dp-index__map { background: #f0f2f5; position: relative; }
#map { width: 100%; height: 100%; }
.dp-index__panel {
  background: #f0f2f5;
  padding: 14px;
  overflow-y: auto;
}

/* ===== 日程卡片(出发/返回/天数) ===== */
.dp-schedule {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.dp-schedule__item {
  flex: 1;
  display: flex; flex-direction: column;
}
.dp-schedule__label {
  font-size: 12px;
  color: #909399;
  margin-bottom: 4px;
}
.dp-schedule__days-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ebeef5;
  width: 100%;
  box-sizing: border-box;
}
.dp-schedule__days {
  font-size: 22px;
  font-weight: 600;
  color: #409EFF;
  line-height: 1;
  margin: 0 2px;
}

/* ===== 日期分组卡片 ===== */
.dp-day-card {
  border: 1px solid #ebeef5;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 21, 41, .04);
}
.dp-day-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fafbfc;
  border-bottom: 1px solid #ebeef5;
  border-radius: 4px 4px 0 0;
}
.dp-day-card__num {
  background: #409EFF;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}
.dp-day-card__date {
  font-size: 13px;
  color: #303133;
  font-weight: 500;
  flex: 1;
}
.dp-day-card__date.is-weekend { color: #f56c6c; }
.dp-day-card__del {
  background: transparent;
  border: none;
  color: #c0c4cc;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
}
.dp-day-card__del:hover { color: #f56c6c; }
.dp-day-card__body {
  padding: 10px 12px;
}

/* POI 列表(在日期卡片内) */
.poi-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.poi-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 6px; align-items: center;
}
.poi-row__idx {
  width: 20px; height: 20px; border-radius: 50%;
  background: #409EFF; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.poi-row__idx.is-ok { background: #67c23a; }
.poi-row__idx.is-err { background: #f56c6c; }
.poi-row__addr {
  font-size: 12px; color: #909399;
  margin-top: 2px;
  word-break: break-all;       /* 长地址换行,不省略 */
  overflow-wrap: anywhere;
}

/* POI 搜索行(input + 搜索按钮同行) */
.poi-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.poi-search-row .dp-input { flex: 1; min-width: 0; }

/* POI 添加行(添加兴趣点按钮单独一行) */
.poi-add-row {
  margin-top: 8px;
}

/* POI 候选下拉 */
.poi-candidates {
  background: #f5f7fa;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.poi-candidate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid #ebeef5;
  cursor: pointer;
  gap: 2px;
  transition: background .12s;
}
.poi-candidate:last-child { border-bottom: none; }
.poi-candidate:hover { background: #ecf5ff; }
.poi-candidate__name {
  font-weight: 500;
  color: #303133;
  font-size: 13px;
  line-height: 1.45;
  width: 100%;
  word-break: break-all;       /* 长名字换行,不省略 */
}
.poi-candidate__addr {
  font-size: 12px;
  color: #909399;
  line-height: 1.4;
  width: 100%;
  word-break: break-all;       /* 长地址换行,不省略 */
}
.poi-candidate__type {
  font-size: 11px;
  color: #c0c4cc;
  background: #fff;
  border: 1px solid #ebeef5;
  padding: 1px 6px;
  border-radius: 2px;
  margin-top: 2px;
  max-width: 100%;
  word-break: break-all;
}
.poi-candidates__empty {
  padding: 20px;
  text-align: center;
  color: #909399;
  font-size: 13px;
}
.poi-candidates__loading {
  padding: 20px;
  text-align: center;
  color: #409EFF;
  font-size: 13px;
}

/* 添加日期/规划路线按钮 */
.dp-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Summary */
.summary { display: flex; gap: 24px; flex-wrap: wrap; }
.summary__item { display: flex; flex-direction: column; }
.summary__label { font-size: 12px; color: #909399; }
.summary__val { font-size: 20px; font-weight: 600; color: #303133; margin-top: 2px; }
.summary__val--warn { color: #e6a23c; }
.summary__val--danger { color: #f56c6c; }

/* Legs */
.legs { display: flex; flex-direction: column; gap: 12px; }
.leg {
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 12px 14px;
  background: #fafbfc;
}
.leg__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: #303133;
}
.leg__arrow { color: #c0c4cc; }
.leg__meta {
  display: flex; gap: 14px;
  font-size: 12px; color: #909399;
  margin-top: 6px;
}
.leg__charge {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ebeef5;
}
.leg__charge-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #e6a23c;
  margin-bottom: 6px;
}
.leg__charge-stops {
  display: flex; flex-direction: column; gap: 4px;
}
.leg__charge-stop {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #606266;
  background: #fdf6ec;
  padding: 5px 10px;
  border-radius: 3px;
}
.leg__charge-stop-name { flex: 1; }
.leg__charge-stop-dist { color: #909399; font-variant-numeric: tabular-nums; }

/* ==========================================================
   占位页
   ========================================================== */
.dp-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}
.dp-placeholder__icon { font-size: 64px; margin-bottom: 16px; }
.dp-placeholder__title { font-size: 22px; font-weight: 600; color: #303133; margin-bottom: 8px; }
.dp-placeholder__desc { font-size: 14px; color: #909399; margin-bottom: 20px; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
