/* ============================================================
   基础组件样式 — 公共 UI primitives
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  color: var(--text-main);
}

/* === 设备外壳 === */
.device-frame {
  width: var(--device-w);
  height: var(--device-h);
  background: var(--page-bg);
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 12px #1a1a1a, 0 0 0 13px #333, 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

/* 审计截图只保留产品界面，去掉 HTML 评审设备壳。 */
body.ui-audit .device-frame {
  border-radius: 0;
  box-shadow: none;
}

/* === 状态栏 === */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--text-main);
  flex-shrink: 0;
  z-index: 100;
  background: transparent;
}
.status-bar .sb-time { font-variant-numeric: tabular-nums; }
.status-bar .sb-right { display: flex; align-items: center; gap: 5px; }

/* === 性别切换胶囊 === */
.gender-toggle {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 200;
  display: flex;
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 3px;
  box-shadow: var(--shadow-card);
  gap: 2px;
}
.gender-toggle button {
  border: none;
  background: transparent;
  width: 32px;
  height: 28px;
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: all var(--dur-short) var(--ease-standard);
  color: var(--text-muted);
}
.gender-toggle button.active {
  color: var(--text-white);
}
.gender-toggle button.active.male {
  background: var(--male-accent);
}
.gender-toggle button.active.female {
  background: var(--female-accent);
}

/* === 可滚动内容区 === */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.page-scroll::-webkit-scrollbar { width: 0; }

/* === 页面头部 === */
.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-16);
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.app-header .ah-title {
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
  color: var(--text-main);
  flex: 1;
}
.app-header .ah-back,
.app-header .ah-more {
  border: none;
  background: none;
  cursor: pointer;
  padding: var(--sp-8);
  display: flex;
  align-items: center;
}
.app-header .ah-back img,
.app-header .ah-more img {
  width: 24px;
  height: 24px;
}

/* === 底部导航 === */
.bottom-nav {
  height: var(--tabbar-content-h);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
}
.bottom-nav .bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
}
.bottom-nav .bn-item img {
  width: var(--tab-icon-size);
  height: var(--tab-icon-size);
  object-fit: contain;
}
.bottom-nav .bn-item .bn-label {
  font-size: var(--tab-label-size);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}
.bottom-nav .bn-item.active .bn-label {
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

/* === 卡片 === */
.card {
  background: var(--surface);
  border-radius: var(--r-12);
  padding: var(--sp-16);
  box-shadow: var(--shadow-card);
}
.card-flat {
  background: var(--surface);
  border-radius: var(--r-12);
  border: 1px solid var(--border);
}

/* === 按钮 === */
.btn {
  height: var(--cta-h);
  border: none;
  border-radius: var(--r-14);
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  transition: all var(--dur-short) var(--ease-standard);
  text-decoration: none;
  padding: 0 var(--sp-20);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}
.btn-gold {
  background: var(--gold-gradient);
  color: var(--gold-deep);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}
.btn-ghost {
  background: var(--surface-alt);
  color: var(--text-main);
}
.btn-danger {
  background: var(--danger);
  color: var(--text-white);
}
.btn-female {
  background: var(--female-gradient);
  color: var(--text-white);
}

/* === 标签 === */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--sp-8);
  border-radius: var(--r-full);
  font-size: var(--fs-11);
  font-weight: var(--fw-medium);
  gap: 3px;
}
.tag-default { background: var(--surface-alt); color: var(--text-sub); }
.tag-gold { background: var(--gold-soft); color: var(--gold-deep); }
.tag-pink { background: var(--female-pink-soft); color: var(--female-pink-deep); }
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* === 头像 === */
.avatar {
  border-radius: var(--r-full);
  object-fit: cover;
  background: var(--surface-alt);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 50px; height: 50px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 80px; height: 80px; }

/* === 输入框 === */
.input {
  height: var(--input-h);
  border: 1.5px solid var(--border);
  border-radius: var(--r-14);
  padding: 0 var(--sp-16);
  font-size: var(--fs-16);
  background: var(--surface);
  color: var(--text-main);
  outline: none;
  width: 100%;
  font-family: var(--font-sans);
}
.input:focus { border-color: var(--primary); }

/* === 列表行 === */
/* 注意：.list-row 完整定义在 pages.css（含 height:50px + 管理组样式），此处仅保留 base 级颜色 */
/* base.css 版本被 pages.css 覆盖（源序在后），迁移时以 pages.css 版本为准 */
.list-row .lr-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-row .lr-label {
  flex: 1;
  font-size: var(--fs-15);
  font-weight: var(--fw-medium);
}
.list-row .lr-value {
  font-size: var(--fs-13);
  color: var(--text-muted);
}
.list-row .lr-chevron {
  width: 20px;
  height: 20px;
  opacity: 0.4;
}

/* === 分组标题 === */
.section-title {
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: var(--text-sub);
  padding: var(--sp-16) var(--sp-16) var(--sp-8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === 空态 === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-48) var(--sp-16);
  color: var(--text-muted);
  gap: var(--sp-8);
}
.empty-state .es-icon {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}
.empty-state .es-text {
  font-size: var(--fs-14);
}

/* === 红点 === */
.dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--r-full);
  background: var(--red-point);
  color: var(--text-white);
  font-size: 10px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* === Sheet 遮罩 === */
.sheet-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--device-w);
  max-width: 100vw;
  background: var(--backdrop);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-panel {
  width: 100%;
  max-width: var(--device-w);
  background: var(--surface);
  border-radius: var(--r-20) var(--r-20) 0 0;
  padding: var(--sp-16) var(--sp-16) calc(var(--sp-16) + env(safe-area-inset-bottom));
  animation: sheetUp var(--dur-medium) var(--ease-decelerate);
  max-height: 85vh;
  overflow-y: auto;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--border);
  margin: 0 auto var(--sp-12);
}

/* === 动画 === */
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-8);
}
