/* =========================================================
   进华智慧社区 (JHCommunity) - 原生 App UI 界面样式
   基于原 iOS 工程色彩体系与组件规范复原
   ========================================================= */

:root {
    --app-blue-top: #36C0FF;
    --app-blue-grad: linear-gradient(180deg, #36C0FF 0%, #22A7F0 100%);
    --app-indigo: #324DEB;
    --app-bg: #F6F7FB;
    --app-card: #FFFFFF;
    --app-text: #222222;
    --app-subtext: #8C9FAD;
    --app-border: #ECEFF4;
    --app-red: #FF3B30;
    --app-green: #34C759;
    --app-gold: #F5A623;
}

.app-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    position: relative;
    user-select: none;
}

/* 主内容可滚动区域 */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 70px;
}

/* =========================================
   1. 顶部自定义导航栏 (NavigationBar)
   ========================================= */
.app-navbar {
    background: var(--app-blue-top);
    padding: 8px 16px 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(54, 192, 255, 0.25);
}

.community-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.community-selector:active {
    background: rgba(255, 255, 255, 0.35);
}

.community-name {
    font-size: 14px;
    font-weight: 600;
}

.nav-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: rotate(45deg);
    margin-top: -3px;
    margin-left: 2px;
}

.navbar-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* =========================================
   2. 首页常用服务金刚区 (JHHomeCommonServiceCell)
   ========================================= */
.home-header-banner {
    background: var(--app-blue-top);
    padding: 10px 16px 20px 16px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.banner-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.banner-text p {
    font-size: 12px;
    opacity: 0.85;
}

.banner-logo {
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.service-card-section {
    margin: -14px 14px 14px 14px;
    background: var(--app-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--app-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: var(--app-blue-top);
    border-radius: 2px;
}

.section-more {
    font-size: 12px;
    color: var(--app-subtext);
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* 常用服务 2x2 布局 (精确复原 JHHomeCommonServiceCell) */
.quick-service-container {
    display: flex;
    gap: 12px;
}

.service-hero-box {
    width: 96px;
    background: linear-gradient(135deg, #36C0FF 0%, #1D8BF2 100%);
    border-radius: 12px;
    padding: 12px;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(54, 192, 255, 0.3);
    cursor: pointer;
}

.service-hero-box span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.service-hero-box img {
    width: 38px;
    height: 38px;
    align-self: flex-end;
}

.service-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.service-btn {
    background: #F8FAFC;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.service-btn:active {
    transform: scale(0.96);
    background: #EDF2F7;
}

.service-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.service-btn span {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

/* 小红点提醒 */
.red-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 8px;
    height: 8px;
    background: var(--app-red);
    border-radius: 10px;
    border: 2px solid #FFFFFF;
}

.red-badge.count {
    padding: 1px 5px;
    height: 16px;
    font-size: 10px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* =========================================
   3. 社区头条与资讯流 (JHHomeCommunityHeadlineCell)
   ========================================= */
.headline-section {
    margin: 0 14px 16px 14px;
}

.article-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.article-filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: 5px 12px;
    background: #FFFFFF;
    border-radius: 20px;
    font-size: 12px;
    color: #64748B;
    border: 1px solid var(--app-border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--app-blue-top);
    color: #FFFFFF;
    border-color: var(--app-blue-top);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(54, 192, 255, 0.3);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-card {
    background: var(--app-card);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.15s;
}

.article-card:active {
    transform: scale(0.98);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.article-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.article-tag.通知 { background: #E0F2FE; color: #0284C7; }
.article-tag.问卷 { background: #FEF3C7; color: #D97706; }
.article-tag.投票 { background: #EDE9FE; color: #7C3AED; }
.article-tag.公示 { background: #DCFCE7; color: #16A34A; }

.article-date {
    font-size: 11px;
    color: var(--app-subtext);
}

.article-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text);
    line-height: 1.4;
    margin-bottom: 6px;
}

.article-summary {
    font-size: 12px;
    color: #64748B;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   4. 底部 TabBar 导航 (JHBaseTabBarController)
   ========================================= */
.app-tabbar {
    height: 60px;
    background: #FFFFFF;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--app-subtext);
    font-size: 10px;
    font-weight: 500;
    position: relative;
    transition: all 0.2s;
}

.tab-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
    transition: transform 0.2s;
}

.tab-item.active {
    color: var(--app-indigo);
    font-weight: 600;
}

.tab-item.active img {
    transform: translateY(-2px);
}

/* =========================================
   5. 物业工作台视图 (JHPropertyWorkController)
   ========================================= */
.work-view {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.worker-profile-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: 16px;
    padding: 16px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}

.worker-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.worker-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.worker-tag {
    font-size: 10px;
    background: #3B82F6;
    padding: 2px 6px;
    border-radius: 10px;
}

.worker-info p {
    font-size: 12px;
    color: #94A3B8;
}

/* GPS 考勤打卡模块 */
.attendance-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.attendance-status-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 12px;
}

.attendance-distance {
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-sign {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    border: none;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    margin: 10px auto;
}

.btn-sign:active {
    transform: scale(0.94);
}

.btn-sign small {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}

.chain-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #2563EB;
    background: #EFF6FF;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
}

/* 物业工单列表 */
.work-repair-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 10px;
    border-left: 4px solid var(--app-blue-top);
}

.work-repair-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.repair-status-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.status-pending { background: #FEF3C7; color: #D97706; }
.status-accepted { background: #DBEAFE; color: #1D4ED8; }
.status-ongoing { background: #E0E7FF; color: #4338CA; }
.status-done { background: #D1FAE5; color: #047857; }

.work-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.btn-action-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary-sm { background: var(--app-blue-top); color: #FFFFFF; }
.btn-success-sm { background: var(--app-green); color: #FFFFFF; }

/* =========================================
   6. 弹窗与抽屉 (Modals & Sheets)
   ========================================= */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: #FFFFFF;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    max-height: 85%;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F1F5F9;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--app-text);
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F1F5F9;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 门禁二维码动效 */
.qr-container {
    text-align: center;
    padding: 10px 0 20px 0;
}

.qr-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px auto;
    padding: 12px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-box canvas {
    width: 176px;
    height: 176px;
}

.qr-scanner-line {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #36C0FF, transparent);
    animation: scanLine 2s infinite linear;
}

@keyframes scanLine {
    0% { top: 12px; }
    50% { top: 188px; }
    100% { top: 12px; }
}

.btn-open-door {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #36C0FF 0%, #2563EB 100%);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
}

.btn-open-door:active {
    transform: scale(0.98);
}

/* 电梯监控组件 (FLYElevator) */
.elevator-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.elevator-unit {
    background: #0F172A;
    border-radius: 14px;
    padding: 14px;
    color: #FFFFFF;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.elevator-floor {
    font-size: 38px;
    font-weight: 800;
    color: #38BDF8;
    font-family: "JetBrains Mono", monospace;
    margin: 6px 0;
}

.elevator-status-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-call-lift {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: #38BDF8;
    color: #0F172A;
    font-size: 12px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}

/* 支付收银台 BottomSheet */
.pay-amount-box {
    text-align: center;
    padding: 20px 0;
}

.pay-amount {
    font-size: 34px;
    font-weight: 800;
    color: #0F172A;
}

.pay-method-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.pay-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pay-method-item.selected {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.method-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.method-icon {
    width: 26px;
    height: 26px;
}

/* 消息通知 Toast */
.app-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(15, 23, 42, 0.92);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 200;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.app-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
