/* =========================================================================
 * 58-tokens.css —— 58 同城 UI 复刻：设计 token + 通用组件
 * 色值/尺寸全部来自 _apktool/res/values/{colors,dimens}.xml 与 m.58.com 实测，
 * 说明见《58同城UI复刻PRD-v1.0.md》第 2、5 节。
 * 载入顺序：app.css 之后 → 同名变量覆盖旧品牌色，组件用 v58- 前缀避免冲突。
 * ========================================================================= */

:root {
  /* 58 品牌色（colors.xml: color_FF552E / ajkColorFF552E / car_FF552E） */
  --brand: #FF552E;
  --brand-deep: #E8461F;
  --brand-soft: #FFF2EF;

  --c-brand: #FF552E;
  --c-brand-press: #E8461F;
  --c-brand-soft: #FFF2EF;
  --c-head: #FF552E;
  --c-head-search: rgba(255, 123, 93, .9);
  --c-head-ph: #FFDAD3;

  --c-text-1: #111111;
  --c-text-2: #333333;
  --c-text-3: #666666;
  --c-text-4: #999999;
  --c-text-5: #BBBBBB;

  --c-line: #EEEEEE;
  --c-line-2: #F5F5F5;
  --c-bg: #F5F6F8;
  --c-card: #FFFFFF;
  --c-price: #FF552E;
  --c-tag-bg: #FFF6F4;
  --c-mask: rgba(0, 0, 0, .5);

  /* 尺寸（dimens.xml 1:1） */
  --h-header: 55px;          /* 首页 header，m.58.com 实测 55 */
  --h-search: 30px;          /* header 内搜索框 */
  --h-search-area: 64px;     /* home_page_search_height */
  --h-navbar: 44px;          /* hy_common_title_bar_height */
  --h-tabbar: 60px;          /* bottom_tab_height */
  --h-bottom-bar: 70px;      /* job_main_bottom_tab_height */
  --r-card: 8px;
  --r-tag: 3px;

  /* 旧变量对齐：让现存页面跟随 58 色板 */
  --ink: #111111;
  --ink-2: #666666;
  --ink-3: #999999;
  --line: #EEEEEE;
  --bg: #F5F6F8;
  --ok: #23C993;
  --warn: #FF720B;
  --err: #E8461F;
}

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--c-text-1);
}
.num, .v58-card__salary, .v58-price { font-variant-numeric: tabular-nums; }

/* ============================ 首页 header ============================ */
.v58-header {
  flex: 0 0 auto;
  height: var(--h-header);
  background: var(--c-head);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #fff;
}
.v58-header__city {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  color: #fff;
  font: 500 15px/1 inherit;
  font-family: inherit;
  padding: 6px 0;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
}
.v58-header__city i {
  font-style: normal;
  font-size: 10px;
  opacity: .85;
  transform: translateY(1px);
}
.v58-header__search {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--h-search);
  border-radius: 15px;
  background: var(--c-head-search);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--c-head-ph);
  font-size: 13px;
}
.v58-header__search svg { width: 14px; height: 14px; flex: 0 0 14px; opacity: .9; }
.v58-header__search span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v58-header__act {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.v58-header__act svg { width: 21px; height: 21px; }
.v58-header__act .badge {
  position: absolute;
  top: -2px;
  right: -3px;
  color: #fff;
  background: #FF2D2D;
  border: 1px solid #fff;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  padding: 0 2px;
  line-height: 12px;
  text-align: center;
}

/* ============================ 金刚区（5列） ============================ */
.v58-cats {
  background: #fff;
  padding: 10px 0 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  row-gap: 12px;
}
.v58-cats__item {
  border: 0;
  background: none;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  position: relative;
}
.v58-cats__item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  pointer-events: none;
}
.v58-cats__item span {
  font-size: 11px;
  line-height: 1.2;
  color: var(--c-text-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v58-cats__item:active img { opacity: .82; }
.v58-cats__dot {
  position: absolute;
  top: -2px;
  right: 14%;
  background: #FF2D2D;
  color: #fff;
  font-size: 9px;
  line-height: 12px;
  height: 12px;
  padding: 0 3px;
  border-radius: 6px;
  font-style: normal;
}

/* ============================ 模块标题 / 文字链 ============================ */
.v58-mod {
  margin-top: 8px;
  background: #fff;
  padding-bottom: 4px;
}
.v58-mod__head {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.v58-mod__title {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text-1);
  letter-spacing: -.2px;
}
.v58-mod__title i {
  font-style: normal;
  color: var(--c-brand);
  font-size: 15px;
  transform: translateY(1px);
}
.v58-mod__more {
  margin-left: auto;
  border: 0;
  background: none;
  font: 400 12px/1 inherit;
  font-family: inherit;
  color: var(--c-text-4);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
}
.v58-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 16px;
  padding: 4px 12px 14px;
}
.v58-links button {
  border: 0;
  background: none;
  padding: 0;
  font: 400 14px/1.2 inherit;
  font-family: inherit;
  color: var(--c-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.v58-links button.is-hot { color: var(--c-brand); }

/* ============================ 首页信息流卡片 ============================ */
.v58-feed { background: #fff; margin-top: 8px; }
.v58-feed__title {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 14px 12px 10px;
  font-size: 17px;
  font-weight: 600;
}
.v58-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: .5px solid var(--c-line);
  background: #fff;
  padding: 12px;
  font-family: inherit;
}
.v58-card:active { background: #F7F7F7; }
.v58-card__row { display: flex; gap: 10px; }
.v58-card__main { flex: 1 1 auto; min-width: 0; }
.v58-card__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--c-text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.v58-card__salary {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-price);
}
.v58-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-text-3);
}
.v58-card__co {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.v58-card__time {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--c-text-5);
}
.v58-card__tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.v58-tag {
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  border-radius: var(--r-tag);
  background: var(--c-tag-bg);
  color: var(--c-brand);
  font-size: 10.5px;
  white-space: nowrap;
}
.v58-tag--gray { background: #F5F6F8; color: var(--c-text-3); }
.v58-card__pic {
  flex: 0 0 120px;
  width: 120px;
  height: 90px;
  border-radius: 6px;
  object-fit: cover;
  background: #F2F3F5;
}
/* business_onepic：单张大图 */
.v58-card--onepic .v58-card__pic {
  flex: 0 0 auto;
  width: 100%;
  height: 168px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.v58-card__corner {
  margin-left: 6px;
  font-size: 10.5px;
  color: var(--c-text-4);
  font-weight: 400;
}

/* ============================ 底部 tabbar（58 版） ============================ */
.tabbar {
  flex: 0 0 calc(var(--h-tabbar) + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  border-top: .5px solid var(--c-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar__item {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-text-2);
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  position: relative;
}
.tabbar__item svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.tabbar__item .ico { display: none; }
.tabbar__item.is-active { color: var(--c-brand); }
.tabbar__item.is-active svg { transform: scale(1.06); }
.tabbar__item:active svg { transform: scale(.94); }
.tabbar__item .badge {
  position: absolute;
  top: 4px;
  left: 56%;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: #FF2D2D;
  color: #fff;
  font-size: 9px;
  line-height: 15px;
  text-align: center;
  border: 1px solid #fff;
  font-style: normal;
}

/* ============================ 页面底色 ============================ */
.page--home { background: var(--c-bg); }
.page--home .page__scroll { background: var(--c-bg); }

/* =========================================================================
 * 存量页面 58 化（P0-2/3 基础）：只覆盖视觉属性，不动 DOM 与逻辑。
 * v2 体系靠变量整体切换，其余按 58 规范逐条覆盖。
 * ========================================================================= */
:root {
  --v2-brand: #FF552E;
  --v2-brand-soft: #FFF2EF;
  --v2-ink: #111111;
  --v2-sub: #666666;
  --v2-line: #EEEEEE;
  --v2-ok: #23C993;
  --v2-warn: #FF720B;
  --v2-err: #E8461F;
}

/* 导航栏：44px，白底，17/500 居中标题，右侧主色 */
.navbar {
  background: #fff;
  box-shadow: none;
  border-bottom: .5px solid var(--c-line);
}
.navbar__title { font-size: 17px; font-weight: 500; color: var(--c-text-1); }
.navbar__back { font-size: 21px; color: var(--c-text-1); }
.navbar__right { font-size: 14px; color: var(--c-brand); }

/* 列表卡：58 通栏白卡，hairline 分割，无圆角无阴影 */
.jobcard {
  background: #fff;
  border-radius: 0;
  margin: 0;
  padding: 12px;
  box-shadow: none;
  border: 0;
  border-bottom: .5px solid var(--c-line);
}
.jobcard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.jobcard__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--c-text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jobcard__salary { font-size: 16px; font-weight: 600; color: var(--c-price); }
.jobcard__meta { margin-top: 8px; gap: 6px; }
.jobcard__foot { margin-top: 8px; font-size: 12px; color: var(--c-text-3); }
.jobcard__foot .co { color: var(--c-text-3); }
.jobcard__dist { font-size: 11px; color: var(--c-text-4); margin-top: 6px; }

/* 标签：58 浅红底 + 主色字，圆角 3，高 18 */
.chip {
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  border-radius: var(--r-tag);
  background: var(--c-tag-bg);
  color: var(--c-brand);
  font-size: 10.5px;
}
.chip--type { background: var(--c-brand); color: #fff; }

/* 筛选条：白底吸顶，选中主色 */
.filterbar {
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: .5px solid var(--c-line);
}
.filterbar__item {
  background: transparent;
  color: var(--c-text-2);
  font-size: 12px;
  border-radius: 0;
  padding: 7px 4px;
}
.filterbar__item.is-on { background: transparent; color: var(--c-brand); font-weight: 600; }

/* 分段控件 / 排序条：58 为纯文字，选中主色加粗，无底色 */
.segment { background: #fff; border-radius: 0; padding: 0; gap: 0; }
.segment__item {
  font-size: 13px;
  color: var(--c-text-2);
  border-radius: 0;
  padding: 11px 0;
  text-align: center;
}
.segment__item.is-on { background: transparent; color: var(--c-brand); font-weight: 600; box-shadow: none; }

/* 详情页（v2 体系） */
.v2-card { border-radius: var(--r-card); box-shadow: none; padding: 14px 12px; }
.v2-card h3 { font-size: 16px; font-weight: 600; }
.v2-jobhead { background: #fff; padding: 14px 12px; margin-bottom: 8px; }
.v2-jobhead h1 { font-size: 20px; font-weight: 600; line-height: 1.35; }
.v2-jobhead__pay { font-size: 20px; font-weight: 600; }
.v2-jobhead__meta { font-size: 12px; color: var(--c-text-3); }
.v2-jobhead__tags em {
  background: var(--c-tag-bg);
  color: var(--c-brand);
  border-radius: var(--r-tag);
  font-size: 10.5px;
  padding: 3px 6px;
}
.v2-bottom {
  background: #fff;
  border-top: .5px solid var(--c-line);
  gap: 8px;
  min-height: var(--h-bottom-bar);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: none;
}
.v2-iconbtn { color: var(--c-text-3); font-size: 11px; }
.v2-iconbtn i { font-size: 20px; }

/* 主按钮：58 胶囊按钮 44px */
.btn--primary {
  height: 44px;
  border-radius: 22px;
  background: var(--c-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: 0;
}
.btn--primary:active { background: var(--c-brand-press); }
.btn--primary[disabled] { background: #FFC2B3; }
.v2-bottom__main { flex: 1; margin: 0; }

/* 消息列表：58 会话行（44 头像 + 16/500 名称 + 13 摘要 + 11 时间） */
.imrow {
  padding: 12px;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-bottom: .5px solid var(--c-line);
}
.imrow .avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 4px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: none;
}
.imrow__name { font-size: 16px; font-weight: 500; color: var(--c-text-1); line-height: 1.3; }
.imrow__time { font-size: 11px; color: var(--c-text-5); font-weight: 400; }
.imrow__msg { margin-top: 4px; font-size: 13px; color: var(--c-text-4); }
.imrow__quote { color: var(--c-text-5); }
.imrow.is-unread .imrow__msg { color: var(--c-text-3); }
.imrow.is-top { background: #FAFAFA; }
.imrow .badge { min-width: 17px; height: 17px; line-height: 17px; font-size: 10.5px; }

/* 消息页顶部分段：58 为通栏三 tab + 选中下划线 */
.segment--bar {
  margin: 0;
  padding: 0;
  gap: 0;
  background: #fff;
  border-radius: 0;
  border-bottom: .5px solid var(--c-line);
}
.segment--bar .segment__item {
  flex: 1 1 0;
  position: relative;
  padding: 13px 0 11px;
  border-radius: 0;
  font-size: 15px;
  color: var(--c-text-2);
}
.segment--bar .segment__item.is-on {
  background: transparent;
  box-shadow: none;
  color: var(--c-brand);
  font-weight: 600;
}
.segment--bar .segment__item.is-on::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-brand);
}
.tag-mini {
  font-size: 10px;
  color: var(--c-brand);
  background: var(--c-tag-bg);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 15px;
  margin-left: 4px;
}

/* 会话页 */
.chat-body { background: var(--c-bg); padding: 12px; }
.chat-readtip { font-size: 11px; color: var(--c-text-5); }
.chat-bubble {
  max-width: 76%;
  padding: 9px 12px;
  border-radius: 4px 12px 12px 12px;
  font-size: 15px;
  line-height: 1.45;
  background: #fff;
  color: var(--c-text-1);
  box-shadow: none;
}
.chat-row.is-mine .chat-bubble { background: var(--c-brand); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-jobcard { border-radius: 8px; border: .5px solid var(--c-line); }
.chat-jobcard button { border: 0; background: var(--c-brand-soft); color: var(--c-brand); }
.chat-quick .kw { background: #fff; border: .5px solid var(--c-line); border-radius: 3px; color: var(--c-text-2); }
.chat-inputbar { border-top: .5px solid var(--c-line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
.chat-inputbar input { background: #F5F6F8; border-radius: 18px; padding: 10px 14px; font-size: 14px; }
.chat-send { background: var(--c-brand); border-radius: 18px; padding: 9px 16px; font-size: 14px; font-weight: 500; }
.chat-send:active { background: var(--c-brand-press); }
.chat-plus { color: var(--c-text-3); }

/* 我的：58 主色头部 + 通栏数据宫格 + 分组列表 */
.profile {
  background: linear-gradient(160deg, #FF6A45 0%, var(--c-brand) 42%);
  padding: 18px 16px 22px;
  color: #fff;
}
.profile__row { gap: 12px; }
.profile__avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .24);
  border: 1px solid rgba(255, 255, 255, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
}
.profile__name { font-size: 18px; font-weight: 600; }
.profile__sub { font-size: 12px; color: rgba(255, 255, 255, .82); margin-top: 4px; }
.profile__role {
  font-size: 11.5px;
  background: rgba(255, 255, 255, .18);
  border-radius: 12px;
  padding: 4px 9px;
}

.statrow {
  margin: 0;
  padding: 14px 0;
  border-radius: 0;
  background: #fff;
  border-bottom: .5px solid var(--c-line);
}

.section {
  padding: 14px 12px 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--c-text-4);
  background: transparent;
}
.section__right { font-size: 12px; color: var(--c-text-4); }

.menu { margin: 0 0 10px; border-radius: 0; background: #fff; }
.menu__item {
  padding: 15px 12px;
  font-size: 15px;
  color: var(--c-text-1);
  border-bottom: .5px solid var(--c-line);
}
.menu__item span:last-child { font-size: 13px; color: var(--c-text-4); }

.cell {
  padding: 0 12px;
  min-height: 48px;
  font-size: 15px;
  color: var(--c-text-1);
  background: #fff;
  border-bottom: .5px solid var(--c-line);
}
.cell__label { color: var(--c-text-1); }
.cell__value { font-size: 13px; color: var(--c-text-4); gap: 4px; }
.cell__value.is-empty { color: var(--c-text-5); }
.cell__value.is-warn { color: var(--c-brand); }
.cell .arrow { color: var(--c-text-5); font-size: 15px; }

.list-foot { font-size: 11px; color: var(--c-text-5); padding: 16px 0 28px; }

/* 城市选择：58 定位卡 + 4 列灰块 */
.notice { margin: 0 0 10px; border-radius: 0; padding: 14px 12px; background: #fff; }
.notice--flat { border: 0; background: #fff; }
.notice--flat b { font-size: 15px; font-weight: 500; color: var(--c-text-1); }
.notice--flat p { margin: 4px 0 0; font-size: 12px; color: var(--c-text-4); }
.citygrid { gap: 4px 8px; padding: 0 12px 8px; }
.citygrid__item {
  border: 0;
  background: transparent;
  border-radius: var(--r-tag);
  padding: 11px 0;
  font-size: 14px;
  color: var(--c-text-2);
}
.citygrid__item.is-on { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }

/* 城市页：58 白底 + 纯文字 4 列网格 */
.page--city, .page--city .page__scroll { background: #fff; }
.page--city .section { background: #fff; color: var(--c-text-4); }
.page--city .notice { border-bottom: .5px solid var(--c-line); margin-bottom: 0; }
