/* ============ 匀城智慧物业 H5 演示版 · 全局样式 ============ */
:root {
  --primary: #1677ff;
  --primary-light: #e8f2ff;
  --orange: #ff7f00;
  --success: #28c76f;
  --warning: #ff9f00;
  --danger: #f5222d;
  --purple: #9f5ffe;
  --pink: #ff429a;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #ebedf0;
  --radius: 12px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: #eef1f5;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ============ 演示页外层 ============ */
.demo-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 40px 24px;
}

.demo-tip {
  max-width: 300px;
  color: #3d4451;
}
.demo-tip h1 {
  margin: 0 0 4px;
  font-size: 26px;
}
.demo-tip-sub {
  margin: 0 0 20px;
  color: var(--orange);
  font-weight: 600;
}
.demo-tip ul {
  margin: 0;
  padding-left: 18px;
  color: #5a6172;
  line-height: 2;
}
.demo-tip b {
  color: var(--primary);
}
.demo-tip-note {
  margin-top: 22px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  color: #8a90a0;
  font-size: 12px;
}

/* ============ 手机外壳 ============ */
.phone {
  position: relative;
  width: 390px;
  height: 780px;
  background: #111;
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(15, 30, 60, 0.28);
  flex-shrink: 0;
}
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 24px;
  background: #111;
  border-radius: 0 0 16px 16px;
  z-index: 5;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 导航栏（模拟小程序 navigationBar） */
.nav-bar {
  flex-shrink: 0;
  height: 62px;
  padding: 22px 12px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 3;
}
.nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.nav-left,
.nav-right {
  min-width: 56px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
}
.nav-right {
  justify-content: flex-end;
}
.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--primary);
  cursor: pointer;
}

/* 页面内容区 */
.page-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}
.page-body::-webkit-scrollbar {
  width: 0;
}

/* 底部 tabBar */
.tab-bar {
  flex-shrink: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  padding-top: 2px;
}
.tab-item.active {
  color: var(--primary);
  font-weight: 600;
}
.tab-icon {
  font-size: 19px;
  line-height: 1;
}
.tab-bar.hidden {
  display: none;
}

/* ============ 通用组件 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin: 10px 12px;
  box-shadow: 0 1px 3px rgba(20, 40, 80, 0.05);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.card-title .more {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
  cursor: pointer;
}
.section-gap {
  height: 8px;
}

/* 列表行 */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.row:last-child {
  border-bottom: none;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
}
.row-arrow {
  color: #c6cad2;
  font-size: 14px;
}
.row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: var(--primary-light);
  flex-shrink: 0;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 17px;
  background: #f2f3f5;
  color: var(--text-2);
}
.tag.blue {
  background: #e8f2ff;
  color: var(--primary);
}
.tag.green {
  background: #e6f9ef;
  color: var(--success);
}
.tag.orange {
  background: #fff3e0;
  color: var(--warning);
}
.tag.red {
  background: #ffeceb;
  color: var(--danger);
}
.tag.purple {
  background: #f3ecff;
  color: var(--purple);
}
.tag.gray {
  background: #f2f3f5;
  color: var(--text-3);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 16px;
  border-radius: 17px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.btn.block {
  width: 100%;
}
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.plain {
  background: #f2f3f5;
  color: var(--text-2);
}
.btn.small {
  height: 26px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 13px;
}
.btn:active {
  opacity: 0.85;
}

/* 空状态 */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon {
  font-size: 34px;
  display: block;
  margin-bottom: 8px;
}

/* 状态栏（首页头部） */
.home-header {
  background: linear-gradient(135deg, #2b7cff 0%, #4f9dff 100%);
  padding: 14px 14px 46px;
  color: #fff;
  position: relative;
}
.home-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.community-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 500;
}
.identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.home-greeting {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 600;
}
.home-sub {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.88;
}

/* 快捷服务网格 */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
  padding: 4px 0;
}
.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}
.service-text {
  font-size: 12px;
  color: var(--text-2);
}
.grid-float {
  margin-top: -38px;
}

/* 动态卡片 */
.news-hero {
  border-radius: 12px;
  background: linear-gradient(135deg, #3d8bff 0%, #67b0ff 100%);
  color: #fff;
  padding: 14px;
  margin-bottom: 10px;
}
.news-hero-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.news-hero-desc {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.9;
}
.news-hero-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.85;
}

/* 统计数字行 */
.stats-row {
  display: flex;
  background: #fff;
  margin: -30px 12px 0;
  border-radius: var(--radius);
  padding: 14px 0;
  box-shadow: 0 2px 10px rgba(20, 40, 80, 0.07);
  position: relative;
  z-index: 2;
}
.stat-item {
  flex: 1;
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 11px;
  color: var(--text-3);
}

/* 个人中心资料卡 */
.profile-card {
  background: linear-gradient(135deg, #2b7cff 0%, #4f9dff 100%);
  padding: 20px 16px 26px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.profile-name {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-addr {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.9;
}
.profile-setting {
  margin-left: auto;
  font-size: 18px;
  opacity: 0.9;
  cursor: pointer;
}

/* 待办 */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
}
.tab.active {
  color: var(--primary);
  font-weight: 600;
}
.tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.todo-item {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: var(--radius);
  padding: 13px;
  margin: 10px 12px;
  box-shadow: 0 1px 3px rgba(20, 40, 80, 0.05);
}
.todo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.todo-title {
  font-size: 14px;
  font-weight: 600;
}
.todo-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.todo-time {
  font-size: 11px;
  color: var(--text-3);
}

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 18px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding-bottom: 16px;
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-dot {
  position: absolute;
  left: -18px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary);
}
.tl-dot.green {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}
.tl-dot.orange {
  background: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}
.tl-time {
  font-size: 11px;
  color: var(--text-3);
}
.tl-title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}
.tl-content {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  background: #f7f8fa;
  border-radius: 8px;
  padding: 8px 10px;
}

/* 投票 */
.vote-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.vote-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.vote-option-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #eef0f4;
  overflow: hidden;
}
.vote-option-bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: #eef0f4;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4f9dff, #1677ff);
}

/* 图表容器 */
.chart-svg {
  width: 100%;
  height: 150px;
  display: block;
}

/* 底部弹层 */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 20;
}
.sheet-mask.show {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 390px;
  max-width: 100vw;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 22px;
  transition: transform 0.25s;
  z-index: 21;
}
.sheet.show {
  transform: translate(-50%, 0);
}
.sheet-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
.sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.sheet-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 30;
  max-width: 240px;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 响应式：窄屏隐藏说明、全屏手机 */
@media (max-width: 900px) {
  .demo-page {
    padding: 0;
    gap: 0;
  }
  .demo-tip {
    display: none;
  }
  .phone {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone-notch {
    display: none;
  }
  .phone-screen {
    border-radius: 0;
  }
  .sheet {
    width: 100vw;
  }
}
