/* ===== 华为工作台 Huawei Workspace ===== */
/* 深圳总部版 · 白底 + 华为红点缀 + 深色头部 */

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", "PingFang HK", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e9ebee;
  color: #16181d;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea { font: inherit; outline: none; border: none; }

/* ===== CSS Variables ===== */
:root {
  --brand: #CF0A2C;
  --brand-dark: #A5081F;
  --brand-light: #fceef1;
  --brand-soft: #fdf5f7;
  --ink: #16181d;
  --ink-2: #2b3038;
  --muted: #6e7480;
  --line: #e2e5ea;
  --soft: #f2f4f7;
  --canvas: #f5f6f8;
  --white: #ffffff;
  --blue: #1d5fd0;
  --blue-soft: #eef3fd;
  --cyan: #0d8fa8;
  --green: #17845c;
  --green-soft: #e9f6f0;
  --amber: #b07400;
  --amber-soft: #fdf3e2;
  --red: #d43a3a;
  --red-soft: #fdecec;
  --dark-1: #16181d;
  --dark-2: #262a33;
  --safe: env(safe-area-inset-bottom, 0px);
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 3px rgba(16,18,22,0.07);
  --transition: 0.2s ease;
}

/* ===== Shell Layout ===== */
.app-shell, .detail-view {
  width: min(540px, 100%);
  margin-inline: auto;
  background: var(--white);
  position: relative;
  min-height: 100vh;
}
.app-shell { border-inline: 1px solid #d8dce2; }

/* ===== Top Bar (light, red mark) ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.top-bar .logo-area { display: flex; align-items: center; gap: 9px; }
.top-bar .logo-area .brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.top-bar .logo-area .logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.top-bar .logo-area .logo-text .app-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink);
}
.top-bar .logo-area .logo-text .app-subtitle {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.1px;
  font-weight: 500;
}
.top-bar .top-actions { display: flex; align-items: center; gap: 2px; }
.top-bar .top-actions button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background var(--transition);
}
.top-bar .top-actions button:active { background: var(--soft); }
.top-bar .top-actions button svg { width: 19px; height: 19px; }
.top-bar .avatar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: min(540px, 100%);
  height: calc(60px + var(--safe));
  padding-bottom: var(--safe);
  background: var(--white);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
}
.bottom-nav button.active { color: var(--brand); }
.bottom-nav button span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.bottom-nav button span svg { width: 22px; height: 22px; }
.bottom-nav button span b {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bottom-nav button em { font-size: 10px; font-style: normal; line-height: 1.2; }

/* ===== Pages ===== */
.page { display: none; min-height: calc(100vh - 116px); padding-bottom: 68px; }
.page.active { display: block; }

/* ===== Home Head (dark) ===== */
.today-head {
  background: linear-gradient(150deg, var(--dark-1) 0%, var(--dark-2) 100%);
  color: var(--white);
  padding: 22px 16px 24px;
  position: relative;
  overflow: hidden;
}
.today-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--brand);
}
.today-head .greeting { font-size: 13px; opacity: 0.72; margin-bottom: 4px; letter-spacing: 0.2px; }
.today-head h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.today-head .name-en {
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-top: 2px;
}
.today-head .sub-title { font-size: 12px; opacity: 0.7; margin-top: 6px; }
.today-head .checkin-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition);
}
.today-head .checkin-btn:active { background: rgba(255,255,255,0.2); }
.today-head .checkin-btn svg { width: 14px; height: 14px; }

/* ===== Page Head ===== */
.page-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 56px;
  z-index: 20;
}
.page-head .page-head-text { display: flex; flex-direction: column; min-width: 0; }
.page-head h2 { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.page-head .page-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.page-head .page-action {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  transition: background var(--transition);
}
.page-head .page-action:active { background: var(--soft); }
.page-head .page-action svg { width: 18px; height: 18px; }

/* ===== Profile Head (Me) ===== */
.profile-head {
  background: linear-gradient(150deg, var(--dark-1) 0%, var(--dark-2) 100%);
  color: var(--white);
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 58px 1fr 46px;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.profile-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--brand);
}
.profile-head .profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.25);
}
.profile-head .profile-info { min-width: 0; }
.profile-head .profile-info h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.3px; }
.profile-head .profile-info .name-en {
  font-size: 10px;
  opacity: 0.55;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 1px;
}
.profile-head .profile-info .role { font-size: 12.5px; opacity: 0.88; margin-top: 5px; }
.profile-head .profile-info .role-en { font-size: 10px; opacity: 0.55; }
.profile-head .profile-info .dept {
  margin-top: 6px;
  font-size: 10px;
  opacity: 0.68;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-head .profile-info .dept .dept-brand-logo { width: 12px; height: 12px; flex-shrink: 0; }
.profile-head .profile-logo { width: 46px; height: 46px; justify-self: end; opacity: 0.9; }
.profile-head .profile-logo img { width: 100%; height: 100%; }

/* ===== Metric Grid ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.metric-grid .metric {
  text-align: center;
  padding: 15px 4px;
  border-right: 1px solid var(--line);
}
.metric-grid .metric:last-child { border-right: none; }
.metric-grid .metric strong {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  word-break: break-word;
}
.metric-grid .metric.brand strong { color: var(--brand); }
.metric-grid .metric.blue strong { color: var(--blue); }
.metric-grid .metric.cyan strong { color: var(--cyan); }
.metric-grid .metric.green strong { color: var(--green); }
.metric-grid .metric.red strong { color: var(--red); }
.metric-grid .metric.amber strong { color: var(--amber); }
.metric-grid .metric span { font-size: 10px; color: var(--muted); }

/* ===== Section ===== */
.section-block { padding: 14px 16px; }
.section-block .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-block .section-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
  position: relative;
  padding-left: 9px;
}
.section-block .section-header h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 13px;
  background: var(--brand);
  border-radius: 2px;
}
.section-block .section-header .more-link { font-size: 11px; color: var(--muted); font-weight: 500; }

/* ===== Alert Strip ===== */
.alert-strip {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  margin: 12px 16px 0;
  background: var(--brand-soft);
  border: 1px solid rgba(207,10,44,0.16);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition);
}
.alert-strip:active { background: #fbe3e8; }
.alert-strip svg { color: var(--brand); width: 17px; height: 17px; }
.alert-strip .alert-title { color: var(--brand); font-weight: 600; }
.alert-strip .alert-badge {
  font-size: 10px;
  color: var(--brand);
  background: rgba(207,10,44,0.1);
  padding: 2px 6px;
  border-radius: 3px;
}
.alert-strip .alert-arrow { color: var(--brand); opacity: 0.45; }

/* ===== Focus Row ===== */
.focus-row {
  display: grid;
  grid-template-columns: 42px 3px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}
.focus-row:active { background: var(--soft); }
.focus-row .focus-time { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: center; }
.focus-row .focus-bar { width: 3px; height: 36px; border-radius: 2px; }
.focus-row .focus-bar.brand { background: var(--brand); }
.focus-row .focus-bar.blue { background: var(--blue); }
.focus-row .focus-bar.red { background: var(--red); }
.focus-row .focus-bar.amber { background: var(--amber); }
.focus-row .focus-bar.green { background: var(--green); }
.focus-row .focus-content { min-width: 0; }
.focus-row .focus-content .focus-type { font-size: 10px; color: var(--muted); margin-bottom: 1px; }
.focus-row .focus-content .focus-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.focus-row .focus-content .focus-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.focus-row .focus-status {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.focus-row .focus-status.brand { background: var(--brand-light); color: var(--brand); }
.focus-row .focus-status.blue { background: var(--blue-soft); color: var(--blue); }
.focus-row .focus-status.red { background: var(--red-soft); color: var(--red); }
.focus-row .focus-status.amber { background: var(--amber-soft); color: var(--amber); }
.focus-row .focus-status.green { background: var(--green-soft); color: var(--green); }

/* ===== Agenda Row ===== */
.agenda-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}
.agenda-row:active { background: var(--soft); }
.agenda-row .agenda-time { font-size: 11px; color: var(--muted); font-weight: 500; }
.agenda-row .agenda-title { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.agenda-row .agenda-meta { font-size: 10.5px; color: var(--muted); }
.agenda-row .agenda-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--soft);
  color: var(--ink-2);
  font-weight: 500;
}
.agenda-row .agenda-tag:empty { display: none; }

/* ===== News Row ===== */
.news-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}
.news-row:active { background: var(--soft); }
.news-row .news-cat {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
  justify-self: start;
}
.news-row .news-title { font-size: 12.5px; color: var(--ink); line-height: 1.35; }
.news-row .news-meta { font-size: 10.5px; color: var(--muted); grid-column: 2; }

/* ===== Client Card ===== */
.client-card {
  padding: 13px 14px;
  margin: 10px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.client-card:active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.client-card .cc-top { display: flex; align-items: flex-start; gap: 10px; }
.client-card .cc-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--dark-1);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.client-card .cc-info { flex: 1; min-width: 0; }
.client-card .cc-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.client-card .cc-name-en {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card .cc-tags { display: flex; align-items: center; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.client-card .cc-tags .tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.client-card .cc-tags .tag.industry { background: var(--soft); color: var(--ink-2); }
.client-card .cc-tags .tag.tier { background: var(--brand-light); color: var(--brand); }
.client-card .cc-health {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.client-card .cc-health.good { background: var(--green-soft); color: var(--green); }
.client-card .cc-health.watch { background: var(--amber-soft); color: var(--amber); }
.client-card .cc-health.risk { background: var(--red-soft); color: var(--red); }
.client-card .cc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--muted);
}
.client-card .cc-foot .cc-amount { color: var(--ink); font-weight: 700; font-size: 12px; letter-spacing: -0.2px; }
.client-card .cc-foot .cc-next { display: flex; align-items: center; gap: 4px; min-width: 0; }
.client-card .cc-foot .cc-next svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--brand); }
.client-card .cc-foot .cc-next span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Opportunity Card ===== */
.opp-card {
  padding: 13px 14px;
  margin: 10px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.opp-card:active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.opp-card .oc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.opp-card .oc-title { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.opp-card .oc-client {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.opp-card .oc-client b { color: var(--ink-2); font-weight: 600; }
.opp-card .oc-amount {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.opp-card .oc-stage-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opp-card .oc-stage {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
}
.opp-card .oc-stage.closing { background: var(--brand-light); color: var(--brand); }
.opp-card .oc-stage.neg { background: var(--amber-soft); color: var(--amber); }
.opp-card .oc-stage.prop { background: var(--cyan); color: #fff; }
.opp-card .oc-stage.disc { background: var(--soft); color: var(--muted); }
.opp-card .oc-prob-track {
  flex: 1;
  height: 4px;
  background: var(--soft);
  border-radius: 2px;
  overflow: hidden;
}
.opp-card .oc-prob-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, #e8556f 100%);
  transition: width 0.4s ease;
}
.opp-card .oc-prob-num { font-size: 11px; font-weight: 700; color: var(--ink-2); width: 34px; text-align: right; }
.opp-card .oc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  color: var(--muted);
}
.opp-card .oc-foot .oc-next { display: flex; align-items: center; gap: 4px; min-width: 0; }
.opp-card .oc-foot .oc-next svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--brand); }
.opp-card .oc-foot .oc-next span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opp-card .oc-foot .risk-tag { padding: 1px 6px; border-radius: 3px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.opp-card .oc-foot .risk-tag.low { background: var(--green-soft); color: var(--green); }
.opp-card .oc-foot .risk-tag.mid { background: var(--amber-soft); color: var(--amber); }
.opp-card .oc-foot .risk-tag.high { background: var(--red-soft); color: var(--red); }

/* ===== Service Row ===== */
.service-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 10px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}
.service-row:active { background: var(--soft); }
.service-row .service-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-row .service-icon svg { width: 17px; height: 17px; }
.service-row .service-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.service-row .service-title-en { font-size: 9.5px; color: var(--muted); letter-spacing: 0.3px; }
.service-row .service-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.service-row .service-arrow { color: var(--line); }
.service-row .service-arrow svg { width: 14px; height: 14px; }

/* ===== Mail Row ===== */
.mail-row {
  display: grid;
  grid-template-columns: 1fr 22px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--soft);
}
.mail-row:active { background: var(--soft); }
.mail-row.unread { background: var(--brand-soft); }
.mail-row.unread:active { background: #fbe3e8; }
.mail-row .mail-main { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: flex-start; }
.mail-row .mail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--dark-1);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.mail-row.unread .mail-avatar { background: var(--brand); }
.mail-row .mail-body { min-width: 0; }
.mail-row .mail-body .mail-sender { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.mail-row.unread .mail-body .mail-sender { font-weight: 700; }
.mail-row .mail-body .mail-subject {
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-row .mail-body .mail-preview {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-row .mail-body .mail-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mail-row .mail-body .mail-meta .mail-tag {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 500;
}
.mail-row .mail-star {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  color: var(--line);
  transition: color var(--transition);
}
.mail-row .mail-star.starred { color: var(--amber); }
.mail-row .mail-star svg { width: 15px; height: 15px; }

/* ===== Filter Rail ===== */
.filter-rail {
  display: flex;
  gap: 7px;
  padding: 11px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-rail::-webkit-scrollbar { display: none; }
.filter-rail button {
  flex-shrink: 0;
  padding: 5px 13px;
  font-size: 11.5px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.filter-rail button.active { background: var(--brand); color: var(--white); font-weight: 600; }
.filter-rail button:active { transform: scale(0.97); }

/* ===== Search Field ===== */
.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 11px 16px 0;
  padding: 8px 12px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--muted);
}
.search-field svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.search-field input { flex: 1; background: none; font-size: 12.5px; color: var(--ink); min-width: 0; }
.search-field input::placeholder { color: var(--muted); }

/* ===== Profile Menu ===== */
.profile-menu { padding: 6px 0; }
.profile-menu .menu-item {
  display: grid;
  grid-template-columns: 22px 1fr 14px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.profile-menu .menu-item:active { background: var(--soft); }
.profile-menu .menu-item .menu-icon { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.profile-menu .menu-item .menu-icon svg { width: 18px; height: 18px; }
.profile-menu .menu-item .menu-label { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.profile-menu .menu-item .menu-arrow { color: var(--line); }
.profile-menu .menu-item .menu-arrow svg { width: 14px; height: 14px; }

/* ===== Brand Footer ===== */
.brand-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}
.brand-footer .brand-footer-logo { width: 36px; height: 36px; flex-shrink: 0; }
.brand-footer-text { flex: 1; }
.brand-footer-text > div:first-child { font-size: 12px; font-weight: 700; color: var(--ink); }
.brand-footer-text .brand-footer-sub { font-size: 9px; color: var(--muted); margin-top: 2px; letter-spacing: 0.3px; }
.brand-footer-text .brand-footer-copy { font-size: 9.5px; color: var(--muted); margin-top: 4px; }

/* ===== Detail View ===== */
.detail-view {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(540px, 100%);
  height: 100%;
  background: var(--white);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-view[hidden] { display: none; }
.detail-view .detail-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 52px;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--line);
}
.detail-view .detail-head .back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  transition: background var(--transition);
}
.detail-view .detail-head .back-btn:active { background: var(--soft); }
.detail-view .detail-head .back-btn svg { width: 19px; height: 19px; }
.detail-view .detail-head .detail-title { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; }
.detail-view .detail-body { padding: 16px; }
.detail-view .detail-body .detail-section { margin-bottom: 20px; }
.detail-view .detail-body .detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-view .detail-body .detail-section h4::before {
  content: "";
  width: 3px;
  height: 11px;
  background: var(--brand);
  border-radius: 2px;
}
.detail-view .detail-body .detail-section p { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.detail-view .detail-body .detail-hero {
  padding: 14px;
  background: var(--canvas);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.detail-view .detail-body .detail-hero .dh-name { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.detail-view .detail-body .detail-hero .dh-name-en {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.detail-view .detail-body .detail-hero .dh-code { font-size: 11px; color: var(--muted); margin-top: 6px; }
.detail-view .detail-body .detail-hero .dh-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.detail-view .detail-body .detail-hero .dh-tags .tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--white);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.detail-view .detail-body .detail-hero .dh-tags .tag.brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.detail-view .detail-body .detail-section .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-view .detail-body .detail-section .info-grid .info-item label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.detail-view .detail-body .detail-section .info-grid .info-item span {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.detail-view .detail-body .detail-section .action-list { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-view .detail-body .detail-section .action-list .action-btn {
  padding: 7px 15px;
  font-size: 12px;
  border-radius: 5px;
  background: var(--brand);
  color: var(--white);
  font-weight: 600;
  transition: background var(--transition);
}
.detail-view .detail-body .detail-section .action-list .action-btn:active { background: var(--brand-dark); }
.detail-view .detail-body .detail-section .action-list .action-btn.ghost {
  background: var(--soft);
  color: var(--ink-2);
}
.detail-view .detail-body .prob-line { display: flex; align-items: center; gap: 10px; }
.detail-view .detail-body .prob-line .track {
  flex: 1;
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  overflow: hidden;
}
.detail-view .detail-body .prob-line .track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #e8556f 100%);
}
.detail-view .detail-body .prob-line .pct { font-size: 13px; font-weight: 700; color: var(--brand); }

/* ===== Compose Sheet ===== */
.sheet-layer {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(540px, 100%);
  height: 100%;
  background: rgba(16,18,22,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-layer[hidden] { display: none; }
.sheet-layer .sheet-content {
  width: 100%;
  background: var(--white);
  border-radius: 14px 14px 0 0;
  padding: 20px 16px;
  padding-bottom: calc(16px + var(--safe));
}
.sheet-layer .sheet-content h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.sheet-layer .sheet-content .field { margin-bottom: 12px; }
.sheet-layer .sheet-content .field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.sheet-layer .sheet-content .field input,
.sheet-layer .sheet-content .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--transition);
}
.sheet-layer .sheet-content .field input:focus,
.sheet-layer .sheet-content .field textarea:focus { border-color: var(--brand); }
.sheet-layer .sheet-content .field textarea { height: 100px; resize: none; }
.sheet-layer .sheet-content .sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sheet-layer .sheet-content .sheet-actions button {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}
.sheet-layer .sheet-content .sheet-actions .cancel-btn { background: var(--soft); color: var(--muted); }
.sheet-layer .sheet-content .sheet-actions .cancel-btn:active { background: var(--line); }
.sheet-layer .sheet-content .sheet-actions .send-btn { background: var(--brand); color: var(--white); }
.sheet-layer .sheet-content .sheet-actions .send-btn:active { background: var(--brand-dark); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 100;
  padding: 9px 22px;
  background: rgba(16,18,22,0.92);
  color: var(--white);
  font-size: 13px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Mail Detail ===== */
.mail-detail-head { padding: 16px; border-bottom: 1px solid var(--soft); }
.mail-detail-head .mail-detail-subject { font-size: 16px; font-weight: 700; margin-bottom: 12px; line-height: 1.35; }
.mail-detail-head .mail-detail-sender { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mail-detail-head .mail-detail-sender .sender-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.mail-detail-head .mail-detail-sender .sender-info .sender-name { font-size: 14px; font-weight: 700; }
.mail-detail-head .mail-detail-sender .sender-info .sender-email { font-size: 11.5px; color: var(--muted); }
.mail-detail-head .mail-detail-time { font-size: 11.5px; color: var(--muted); }
.mail-detail-attachments { padding: 12px 16px; border-bottom: 1px solid var(--soft); }
.mail-detail-attachments .att-title { font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.mail-detail-attachments .att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-detail-attachments .att-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--ink);
  cursor: pointer;
}
.mail-detail-attachments .att-item:active { background: var(--line); }
.mail-detail-attachments .att-item svg { width: 13px; height: 13px; color: var(--muted); }
.mail-detail-attachments .att-item .att-size { color: var(--muted); font-size: 10.5px; }
.mail-detail-body { padding: 16px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.mail-detail-body p { margin-bottom: 10px; }
.mail-detail-body ul, .mail-detail-body ol { margin: 8px 0 8px 20px; }
.mail-detail-body li { margin-bottom: 4px; }
.mail-actions { padding: 0 16px 16px; display: flex; gap: 10px; }
.mail-actions button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.mail-actions button svg { width: 15px; height: 15px; }
.mail-actions .reply-btn { background: var(--brand); color: #fff; }
.mail-actions .fwd-btn { background: var(--soft); color: var(--ink-2); }

/* ===== Profile Detail ===== */
.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 16px; }
.profile-detail-grid .pd-item label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.profile-detail-grid .pd-item span { font-size: 13px; color: var(--ink); font-weight: 600; word-break: break-word; }
.profile-detail-grid .pd-item.wide { grid-column: 1 / -1; }

/* ===== Detail List ===== */
.detail-list .dl-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft);
}
.detail-list .dl-item:last-child { border-bottom: none; }
.detail-list .dl-item svg { width: 15px; height: 15px; color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.detail-list .dl-item .dl-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 44px 16px; color: var(--muted); font-size: 13px; }

/* ===== Responsive ===== */
@media (min-width: 541px) {
  .app-shell, .detail-view { box-shadow: 0 0 30px rgba(16,18,22,0.1); }
  .bottom-nav { box-shadow: 0 -2px 10px rgba(16,18,22,0.05); }
}
