:root {
  --accent: #0A84FF;
  --text-primary: #F2F6FA;
  --text-secondary: #98A6B2;
  --text-muted: #6B7A8A;
  --glass-tint: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.42);
  --glass-shadow: rgba(0, 0, 0, 0.22);
  --success: #30D158;
  --warning: #FF9F0A;
  --error: #FF453A;
  --info: #0A84FF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  background: #0E1A2A;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
  touch-action: manipulation;
}

/* 液态玻璃壁纸：深色底 + 彩色光斑（供 backdrop-filter 折射/模糊） */
body {
  background:
    radial-gradient(ellipse at 12% -5%, rgba(10, 132, 255, 0.34), transparent 55%),
    radial-gradient(ellipse at 90% 8%, rgba(94, 92, 230, 0.30), transparent 55%),
    radial-gradient(ellipse at 45% 108%, rgba(10, 132, 255, 0.22), transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(191, 90, 242, 0.16), transparent 50%),
    linear-gradient(180deg, #111A22 0%, #14202B 48%, #0E1A2A 100%);
}

#app {
  display: flex; flex-direction: column;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.content { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(72px + var(--safe-bottom)); }

/* ===== SVG 图标 ===== */
.header-icon { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.sub-logo-icon { width: 22px; height: 22px; color: #fff; }
.module-icon { width: 22px; height: 22px; color: var(--accent); }
.nav-icon { width: 22px; height: 22px; }
.search-icon { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.section-icon { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.back-icon { width: 26px; height: 26px; color: var(--text-primary); }
.clear-icon { width: 18px; height: 18px; color: var(--text-muted); }

/* ===== 顶部栏 ===== */
.page-header {
  padding: calc(10px + var(--safe-top)) 20px 14px;
  background: var(--glass-tint);
  backdrop-filter: blur(26px) saturate(1.4) brightness(0.96);
  -webkit-backdrop-filter: blur(26px) saturate(1.4) brightness(0.96);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06);
}
.page-header .header-row { display: flex; align-items: center; gap: 10px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.page-header .subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.page-body { padding: 20px; }

/* ===== 卡片 ===== */
.card {
  border-radius: 20px; padding: 16px; margin-bottom: 12px;
  background: var(--glass-tint);
  backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 22px -6px var(--glass-highlight), 0 4px 26px var(--glass-shadow);
}

/* 首页 - 子公司卡片 */
.sub-card {
  display: flex; align-items: center; gap: 14px;
  border-radius: 20px; padding: 16px; margin-bottom: 12px; cursor: pointer;
  background: var(--glass-tint);
  backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 22px -6px var(--glass-highlight), 0 4px 26px var(--glass-shadow);
  transition: transform 0.15s;
}
.sub-card:active { transform: scale(0.98); }
.sub-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sub-info { flex: 1 1 auto; min-width: 0; }
.sub-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.sub-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sub-arrow { color: var(--text-muted); font-size: 20px; }

.section-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin: 4px 0 12px; }

/* HR - 公司统计卡片 */
.stats-card {
  border-radius: 20px; padding: 16px; margin-bottom: 12px;
  background: var(--glass-tint);
  backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(0.96) contrast(1.03);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 22px -6px var(--glass-highlight), 0 4px 26px var(--glass-shadow);
}
.stats-head { display: flex; align-items: baseline; gap: 6px; }
.stats-zh { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.stats-note { font-size: 12px; color: var(--text-muted); }
.stats-en { font-size: 10px; letter-spacing: 0.5px; color: var(--text-muted); margin-top: 2px; }
.stats-total-label { font-size: 12px; color: var(--text-secondary); margin-top: 14px; }
.stats-total { font-size: 34px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stats-divider { height: 1px; background: rgba(255,255,255,0.10); margin: 14px 0; }
.stats-row { display: flex; }
.stats-row + .stats-row { margin-top: 12px; }
.stat-cell { flex: 1 1 0; }
.stat-label { font-size: 11px; color: var(--text-muted); }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 2px; }

/* HR - 模块网格 */
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.module-btn {
  border-radius: 16px; padding: 14px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass-tint);
  backdrop-filter: blur(20px) saturate(1.4) brightness(0.96);
  -webkit-backdrop-filter: blur(20px) saturate(1.4) brightness(0.96);
  box-shadow: inset 0 0 18px -6px var(--glass-highlight), 0 3px 18px var(--glass-shadow);
  transition: transform 0.15s;
}
.module-btn:active { transform: scale(0.94); }
.module-btn .label { font-size: 11px; line-height: 1.3; text-align: center; color: var(--text-primary); }

/* 占位页 */
.placeholder-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.placeholder-desc { font-size: 14px; color: var(--text-secondary); margin-top: 8px; line-height: 1.6; }

/* 底部导航（玻璃） */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 480px;
  display: flex;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: rgba(16, 18, 24, 0.82);
  backdrop-filter: blur(28px) saturate(1.5) brightness(0.94);
  -webkit-backdrop-filter: blur(28px) saturate(1.5) brightness(0.94);
  border-top: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 100;
}
.nav-item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; cursor: pointer; border: none; background: none;
}
.nav-item .nav-icon { color: var(--text-muted); }
.nav-item .label { font-size: 10px; margin-top: 2px; color: var(--text-muted); }
.nav-item.active .nav-icon, .nav-item.active .label { color: var(--accent); }
.nav-item.active .label { font-weight: 600; }

/* Overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse at 12% -5%, rgba(10,132,255,0.34), transparent 55%),
    radial-gradient(ellipse at 90% 8%, rgba(94,92,230,0.30), transparent 55%),
    radial-gradient(ellipse at 45% 108%, rgba(10,132,255,0.22), transparent 60%),
    linear-gradient(180deg, #111A22 0%, #14202B 48%, #0E1A2A 100%);
}
.overlay.hidden { display: none; }

.overlay-header {
  padding: calc(12px + var(--safe-top)) 12px 12px;
  display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 10;
  background: var(--glass-tint);
  backdrop-filter: blur(26px) saturate(1.4) brightness(0.96);
  -webkit-backdrop-filter: blur(26px) saturate(1.4) brightness(0.96);
  border-bottom: 1px solid var(--glass-border);
}
.overlay-header .back { padding: 4px 8px; border: none; background: none; line-height: 1; cursor: pointer; }
.overlay-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }

/* 搜索框 */
.search-box {
  display: flex; align-items: center;
  border-radius: 14px; margin: 12px 16px; padding: 0 14px;
  background: var(--glass-tint);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 18px -6px var(--glass-highlight);
}
.search-box input {
  flex: 1 1 auto; border: none; outline: none; background: none;
  padding: 12px 10px; font-size: 15px; color: var(--text-primary);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .clear { color: var(--text-muted); cursor: pointer; font-size: 18px; }

/* 员工列表 */
.emp-section-header {
  padding: 4px 16px; font-size: 13px; font-weight: 700; color: var(--accent);
}
.emp-card {
  display: flex; align-items: center; gap: 12px;
  border-radius: 16px; margin: 6px 16px; padding: 12px; cursor: pointer;
  background: var(--glass-tint);
  backdrop-filter: blur(20px) saturate(1.4) brightness(0.96);
  -webkit-backdrop-filter: blur(20px) saturate(1.4) brightness(0.96);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 18px -6px var(--glass-highlight), 0 3px 18px var(--glass-shadow);
}
.emp-avatar {
  width: 48px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  border-radius: 0; flex-shrink: 0;
}
.emp-info { flex: 1 1 auto; min-width: 0; }
.emp-name-row { display: flex; justify-content: space-between; align-items: center; }
.emp-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.emp-id { font-size: 12px; color: var(--text-muted); }
.emp-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
.emp-line .sub { color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); font-size: 14px; padding: 40px 0; }

/* 员工完整档案 */
.archive-body { padding: 16px 16px 40px; }
.archive-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.archive-tag {
  background: rgba(255,255,255,0.08); color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 3px 8px; font-size: 11px;
}
.archive-status { background: rgba(48,209,88,0.16); color: var(--success); border-color: rgba(48,209,88,0.3); font-weight: 600; }
.archive-name { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.archive-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.archive-section {
  border-radius: 20px; padding: 16px; margin-top: 12px;
  background: var(--glass-tint);
  backdrop-filter: blur(22px) saturate(1.4) brightness(0.96);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(0.96);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 22px -6px var(--glass-highlight), 0 4px 26px var(--glass-shadow);
}
.archive-section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.archive-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.archive-row:last-child { border-bottom: none; }
.archive-label { color: var(--text-muted); flex-shrink: 0; margin-right: 12px; }
.archive-value { color: var(--text-primary); text-align: right; word-break: break-all; }
