/* ==========================================================================
   嘉鸿 · 项目管理系统（H5 员工端）
   配色沿用嘉鸿内部系统的蓝色系，与 dh.bzjhty.cn 保持一家人
   ========================================================================== */
:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --primary-light: #E8F2FC;
    --success: #52C41A;
    --warning: #FAAD14;
    --danger: #FF4D4F;
    --text-main: #333333;
    --text-secondary: #666666;
    --text-hint: #999999;
    --bg-page: #F5F6FA;
    --bg-card: #FFFFFF;
    --border: #EBEBEB;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, .06);
    --nav-height: 58px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    margin: 0; padding: 0; height: 100%;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }
input, textarea, button, select { font-family: inherit; font-size: 14px; outline: none; }
img { display: block; }

/* ============================ 登录页 ============================ */
.login-page {
    position: fixed; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(160deg, #5B9FE3 0%, #4A90D9 45%, #3A76B8 100%);
    overflow-y: auto;
}
.login-logo {
    width: 62px; height: 62px; border-radius: 18px;
    background: rgba(255, 255, 255, .18);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.login-logo svg { width: 32px; height: 32px; }
.login-title { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.login-subtitle { color: rgba(255, 255, 255, .82); font-size: 13px; margin: 4px 0 22px; }
.login-card {
    width: 100%; max-width: 380px; background: #fff; border-radius: 16px;
    padding: 24px 20px 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, .16);
}
.login-card h2 { margin: 0 0 18px; font-size: 17px; font-weight: 600; text-align: center; }
.login-tip { text-align: center; color: var(--text-hint); font-size: 12px; margin-top: 14px; }

/* ============================ 通用表单 ============================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 7px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 11px 13px; border: 1px solid #DFE3E8; border-radius: 10px;
    background: #fff; color: var(--text-main); transition: border-color .18s, box-shadow .18s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 144, 217, .12);
}
.form-textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; padding-right: 34px; }
.form-hint { font-size: 12px; color: var(--text-hint); margin-top: 6px; }

.btn-primary {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 14px rgba(74, 144, 217, .3); transition: opacity .18s, transform .1s;
}
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
.btn-small {
    padding: 9px 15px; border: none; border-radius: 9px; background: var(--primary);
    color: #fff; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-ghost {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text-secondary); font-size: 12px; cursor: pointer;
}
.btn-ghost-link { display: block; text-align: center; color: var(--primary); font-size: 13px; text-decoration: none; padding: 12px; }

.code-group { display: flex; gap: 9px; }
.code-group .form-input { flex: 1; }
.btn-send-code {
    padding: 0 14px; border: 1px solid var(--primary); border-radius: 10px;
    background: var(--primary-light); color: var(--primary-dark); font-size: 13px;
    white-space: nowrap; cursor: pointer;
}
.btn-send-code:disabled { border-color: #DDD; background: #F5F5F5; color: #AAA; cursor: not-allowed; }

/* ============================ 主应用骨架 ============================ */
.app-container { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--bg-page); box-shadow: 0 0 40px rgba(0,0,0,.05); }
.app-header {
    flex: none; height: 50px; padding: 0 14px; padding-top: env(safe-area-inset-top, 0px);
    box-sizing: content-box;
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; font-size: 16px; font-weight: 600; z-index: 20;
}
.header-right { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 400; }
.header-user { opacity: .92; }
.header-logout { padding: 4px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 20px; cursor: pointer; }
.app-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page { display: none; padding: 12px 12px 18px; }
.page.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.bottom-nav {
    flex: none; display: flex; height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    background: #fff; border-top: 1px solid var(--border); z-index: 20;
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--text-hint); cursor: pointer; transition: color .18s;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-label { font-size: 11px; }
.nav-item.active { color: var(--primary); }

/* ============================ 看板 ============================ */
.range-bar { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.range-bar::-webkit-scrollbar { display: none; }
.chip {
    flex: none; padding: 6px 13px; border-radius: 20px; background: #fff;
    border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; cursor: pointer;
    transition: all .18s;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

.custom-range { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.custom-range .form-input { flex: 1; padding: 8px 10px; font-size: 13px; }
.range-sep { color: var(--text-hint); font-size: 12px; }

.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.stat-card {
    background: #fff; border-radius: var(--radius); padding: 13px 8px; text-align: center;
    box-shadow: var(--shadow);
}
.stat-num { font-size: 21px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-num small { font-size: 12px; font-weight: 400; color: var(--text-hint); margin-left: 1px; }
.stat-label { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }
.stat-card.c-construct .stat-num { color: #D97706; }
.stat-card.c-install .stat-num { color: #059669; }
.stat-card.c-total .stat-num { color: var(--primary); }

.section-title {
    display: flex; align-items: baseline; justify-content: space-between;
    font-size: 14px; font-weight: 600; margin: 4px 2px 9px;
}
.section-sub { font-size: 12px; font-weight: 400; color: var(--text-hint); }

.list { display: flex; flex-direction: column; gap: 10px; }
.rec {
    background: #fff; border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow);
    cursor: pointer; transition: transform .12s;
}
.rec:active { transform: scale(.99); }
.rec-top { display: flex; align-items: flex-start; gap: 11px; }
.rec-thumb { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; background: #F1F3F7; flex: none; }
.rec-thumb.ph { display: flex; align-items: center; justify-content: center; color: #B9C2D0; font-size: 19px; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta + .rec-meta { margin-top: 2px; }
.rec-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-hint); }
.rec-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 2px 8px; border-radius: 5px; font-size: 11px; background: var(--primary-light); color: var(--primary-dark); }
.tag.t-construct { background: #FEF3C7; color: #B45309; }
.tag.t-install { background: #D1FAE5; color: #047857; }
.tag.t-done { background: #DCFCE7; color: #15803D; }
.tag.t-working { background: #FEF9C3; color: #A16207; }
.tag.t-plain { background: #F1F3F7; color: var(--text-secondary); }

.empty { text-align: center; padding: 44px 20px; color: var(--text-hint); font-size: 13px; }
.empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .8; }
.empty-tip { font-size: 12px; margin-top: 4px; color: #B9C2D0; }

/* ============================ 提报 ============================ */
.cat-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 12px; }
.cat-card {
    background: #fff; border-radius: var(--radius); padding: 18px 12px; text-align: center;
    border: 2px solid transparent; box-shadow: var(--shadow); cursor: pointer; transition: all .18s;
}
.cat-card.active { border-color: var(--primary); background: var(--primary-light); }
.cat-icon { font-size: 27px; margin-bottom: 5px; }
.cat-name { font-size: 14.5px; font-weight: 600; }
.cat-desc { font-size: 11.5px; color: var(--text-hint); margin-top: 3px; line-height: 1.4; }

.card { background: #fff; border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card-title { font-size: 14.5px; font-weight: 600; margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.card-title .ct-sub { font-size: 12px; font-weight: 400; color: var(--text-hint); }

.sub-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-item {
    padding: 8px 13px; border-radius: 9px; background: #F5F7FA; border: 1px solid transparent;
    font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .16s;
}
.sub-item.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.sub-group-label { width: 100%; font-size: 12px; color: var(--text-hint); margin: 2px 0 -2px; }

/* 照片分组 */
.photo-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.pg-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 13px; cursor: pointer; background: #FAFBFC;
}
.pg-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pg-title .req { color: var(--danger); }
.pg-state { font-size: 12px; color: var(--text-hint); display: flex; align-items: center; gap: 6px; }
.pg-arrow { transition: transform .2s; display: inline-block; }
.photo-group.open .pg-arrow { transform: rotate(90deg); }
.pg-body { display: none; padding: 12px 13px 13px; border-top: 1px solid var(--border); }
.photo-group.open .pg-body { display: block; }

.batch { margin-bottom: 13px; }
.batch:last-child { margin-bottom: 0; }
.batch-title { font-size: 12px; color: var(--text-hint); margin-bottom: 7px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ph-item { position: relative; width: 100%; padding-top: 100%; border-radius: 8px; overflow: hidden; background: #F1F3F7; }
.ph-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-del {
    position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%;
    background: rgba(0, 0, 0, .52); color: #fff; font-size: 13px; line-height: 19px;
    text-align: center; cursor: pointer;
}
.ph-add {
    position: relative; padding-top: 100%; border-radius: 8px; border: 1px dashed #C9D2DE;
    background: #FAFBFC; cursor: pointer;
}
.ph-add span {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #A8B3C2; font-size: 11px; gap: 1px;
}
.ph-add b { font-size: 19px; font-weight: 400; line-height: 1; }
.ph-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #EEF1F6; color: var(--text-hint); font-size: 11px; }

.btn-add-batch {
    width: 100%; padding: 8px; margin-top: 8px; border: 1px dashed #C9D2DE; border-radius: 8px;
    background: #FAFBFC; color: var(--primary); font-size: 12.5px; cursor: pointer;
}

/* 提交栏 */
.submit-bar { display: flex; gap: 10px; margin: 16px 0 6px; }
.submit-bar .btn-primary { flex: 1; }
.btn-cancel {
    padding: 12px 20px; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; color: var(--text-secondary); font-size: 14px; cursor: pointer;
}

/* ============================ 我的 ============================ */
.my-header { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-bottom: 11px; }
.avatar {
    width: 48px; height: 48px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600;
}
.my-info { flex: 1; min-width: 0; }
.my-name { font-size: 16px; font-weight: 600; }
.my-phone { font-size: 12.5px; color: var(--text-hint); }
.my-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.mine-footer { padding: 18px 0 6px; }

/* ============================ 详情 ============================ */
.detail-head { background: #fff; border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-bottom: 12px; }
.detail-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.detail-sub { font-size: 12.5px; color: var(--text-hint); }
.info-row { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 84px; flex: none; color: var(--text-hint); font-size: 13px; }
.info-value { flex: 1; word-break: break-all; }
.info-value a { color: var(--primary); text-decoration: none; }

.detail-photos { display: flex; flex-direction: column; gap: 10px; }
.detail-stage { background: #fff; border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow); }
.ds-head { font-size: 13.5px; font-weight: 600; margin-bottom: 9px; display: flex; justify-content: space-between; }
.ds-head .ds-count { font-size: 12px; font-weight: 400; color: var(--text-hint); }
.ds-batch-label { font-size: 11.5px; color: var(--text-hint); margin: 8px 0 5px; }

/* 备注与评论 */
.remark {
    background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px;
    border: 1px solid var(--border);
}
.remark-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 5px; }
.remark-user { font-weight: 600; color: var(--text-main); }
.remark-time { color: var(--text-hint); font-size: 11.5px; }
.remark-del { margin-left: auto; color: var(--text-hint); font-size: 11.5px; cursor: pointer; }
.remark-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.comments { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: 13px; background: #F7F9FC; border-radius: 8px; padding: 7px 10px; }
.comment b { color: var(--primary-dark); font-weight: 600; }
.comment-time { color: var(--text-hint); font-size: 11px; margin-left: 6px; }
.comment-form { display: flex; gap: 7px; margin-top: 9px; }
.comment-form input { flex: 1; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.comment-form button { padding: 0 14px; border: none; border-radius: 8px; background: var(--primary-light); color: var(--primary-dark); font-size: 13px; cursor: pointer; }

/* ============================ 弹层 / 提示 ============================ */
.sheet-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 200; }
.sheet {
    width: 100%; max-width: 720px; background: #fff; border-radius: 16px 16px 0 0;
    padding: 18px 16px calc(18px + var(--safe-bottom)); max-height: 82vh; overflow-y: auto;
    animation: sheetUp .22s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 14px; font-size: 15.5px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn-primary { flex: 1; }

.toast {
    position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.95);
    background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 20px; border-radius: 10px;
    font-size: 13.5px; z-index: 999; opacity: 0; pointer-events: none; transition: all .2s;
    max-width: 78vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.img-viewer { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 900; display: flex; align-items: center; justify-content: center; }
.img-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

.loading-line { text-align: center; color: var(--text-hint); font-size: 12.5px; padding: 14px; }
.skeleton { background: linear-gradient(90deg, #EEF1F6 25%, #F7F9FC 37%, #EEF1F6 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 78px; margin-bottom: 10px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
