/* ============================================
   人口登记系统 - 自定义样式（Mobile First）
   ============================================ */

/* ---------- 全局基础样式 ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f6fa;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px; /* 底部导航栏高度 + 间距 */
}

/* ---------- 顶部导航栏 ---------- */
.navbar {
    z-index: 1040;
}

/* ---------- 底部导航栏 ---------- */
.nav-bottom-item {
    color: #6c757d;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-bottom-item:hover,
.nav-bottom-item.active {
    color: #0d6efd;
}

.nav-bottom-item.active {
    font-weight: 600;
}

.nav-bottom-item .nav-label {
    font-size: 0.7rem;
    margin-top: 1px;
}

/* ---------- 浮动添加按钮（FAB） ---------- */
.fab-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1030;
    transition: all 0.3s ease;
    text-decoration: none;
}

.fab-btn:hover {
    background-color: #0b5ed7;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.5);
}

/* ---------- 卡片列表样式 ---------- */
.list-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    margin-bottom: 12px;
    overflow: hidden;
}

.list-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.list-card .card-body {
    padding: 14px 16px;
}

.list-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.list-card .card-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.list-card .card-actions {
    border-top: 1px solid #f0f0f0;
    padding: 8px 16px;
    display: flex;
    gap: 8px;
}

.list-card .card-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 4px 0;
}

/* ---------- 搜索栏 ---------- */
.search-bar {
    position: sticky;
    top: 56px;
    z-index: 1020;
    background-color: #f5f6fa;
    padding: 10px 0;
}

.search-bar .form-control {
    border-radius: 20px;
    padding-left: 40px;
    border: 1px solid #dee2e6;
    background-color: #fff;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    z-index: 5;
}

/* ---------- KPI 统计卡片 ---------- */
.kpi-card {
    border: none;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kpi-card .kpi-number {
    color: #FFFFFF;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 0.8rem;
    color: #000000;
    margin-top: 4px;
}

.kpi-card.kpi-total { background: linear-gradient(135deg, #5b7cfa 0%, #8b5cf6 100%); color: #fff; }
.kpi-card.kpi-resident { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); color: #fff; }
.kpi-card.kpi-temp { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); color: #212529; }
.kpi-card.kpi-out { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); color: #fff; }

/* ---------- 表单样式优化（手机端） ---------- */
.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ---------- 图表容器 ---------- */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- 分页样式 ---------- */
.load-more-btn {
    border-radius: 20px;
    padding: 8px 32px;
    font-size: 0.9rem;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ---------- 登录页样式 ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ---------- 加载动画 ---------- */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---------- 响应式调整 ---------- */
@media (min-width: 768px) {
    .kpi-card .kpi-number {
        font-size: 2.2rem;
    }

    .list-card .card-body {
        padding: 18px 20px;
    }

    .fab-btn {
        bottom: 90px;
        right: 30px;
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 992px) {
    main.container-fluid {
        max-width: 960px;
        margin: 0 auto;
    }
}

/* ============================================
   适老化样式 - 大字体、高对比度、易操作
   ============================================ */

/* 投票和会议页面大按钮 */
.btn-lg {
    font-size: 1.15rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
}

/* 投票结果进度条加高 */
.progress {
    height: 32px;
    border-radius: 8px;
    background-color: #e9ecef;
}

.progress-bar {
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
}

/* 卡片间距加大 */
.card {
    border-radius: 12px;
}

.card-body {
    padding: 16px;
}

/* 底部导航图标加大 */
.nav-bottom-item .fs-5 {
    font-size: 1.3rem !important;
}

.nav-bottom-item .nav-label {
    font-size: 0.75rem;
}

/* 适老化模式（扫码登录的文盲用户） */
nav.accessible-mode .nav-bottom-item .fs-5 {
    font-size: 1.8rem !important;
}
nav.accessible-mode .nav-bottom-item .nav-label {
    font-size: 1rem !important;
    font-weight: 600;
}
nav.accessible-mode {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* 列表项加大点击区域 */
.list-group-item {
    padding: 12px 16px;
    font-size: 1rem;
}

/* 语音播报按钮 */
.voice-btn {
    position: fixed;
    bottom: 75px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1030;
    transition: all 0.2s;
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.speaking {
    background-color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
}
