/* ============================================================
   XXX案例管理SAAS - 用户端 H5 移动端
   科技蓝渐变主题, 底部Tab导航, 手机自适应
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f4f5f9;
    -webkit-font-smoothing: antialiased;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ---------- 顶部导航栏 ---------- */
.h5-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 44px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 60, 114, .3);
}
.h5-header .back {
    position: absolute;
    left: 12px;
    top: 0; bottom: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.h5-header .more {
    position: absolute;
    right: 12px;
    top: 0; bottom: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ---------- 底部 Tab 导航 ---------- */
.h5-tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 60px;
    background: #fff;
    display: flex;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}
.h5-tabbar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    transition: color .2s;
    cursor: pointer;
}
.h5-tabbar .tab-item.active { color: #2a5298; }
.h5-tabbar .tab-item i { font-size: 20px; margin-bottom: 3px; }

/* ---------- 主内容区 ---------- */
.h5-content {
    padding: 12px;
    padding-bottom: 72px;
    min-height: calc(100vh - 44px);
}
.h5-content.no-tabbar { padding-bottom: 12px; }

/* ---------- 卡片 ---------- */
.h5-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.h5-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.h5-card-title .more {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

/* ---------- 客服行 ---------- */
.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid #f0f2f5;
    color: #333;
    text-decoration: none;
    transition: background .15s;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:active { background: #f7f9fc; }
.contact-row i:first-child { font-size: 18px; width: 22px; text-align: center; }
.contact-row span { font-size: 13px; color: #666; flex-shrink: 0; }
.contact-row .contact-val {
    flex: 1;
    font-size: 13px;
    color: #2a5298;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 按钮 ---------- */
.h5-btn {
    display: inline-block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.h5-btn:active { transform: scale(.97); }
.h5-btn-primary {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    width: 100%;
}
.h5-btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
}
.h5-btn-outline {
    background: #fff;
    color: #2a5298;
    border: 1px solid #2a5298;
}
.h5-btn-block { width: 100%; }
.h5-btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 16px; }

/* ---------- 列表项 ---------- */
.h5-list .list-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.03);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform .1s;
}
.h5-list .list-item:active { transform: scale(.98); }
.h5-list .item-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}
.h5-list .item-body { flex: 1; min-width: 0; }
.h5-list .item-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-list .item-sub { font-size: 12px; color: #999; }
.h5-list .item-arrow { color: #ccc; font-size: 14px; }

/* ---------- 案件卡片 ---------- */
.case-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    position: relative;
}
.case-card .case-no {
    font-size: 12px;
    color: #2a5298;
    font-weight: 600;
    margin-bottom: 6px;
}
.case-card .case-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.case-card .case-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #888;
}
.case-card .case-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.case-card .status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.status-pending    { background: #fff3e0; color: #e65100; }
.status-processing { background: #e3f2fd; color: #1565c0; }
.status-closed     { background: #e8f5e9; color: #2e7d32; }
.status-cancelled  { background: #f5f5f5; color: #616161; }

/* ---------- 表单 ---------- */
.h5-form .form-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.h5-form .form-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    display: block;
}
.h5-form input[type="text"],
.h5-form input[type="tel"],
.h5-form input[type="number"],
.h5-form input[type="password"],
.h5-form textarea,
.h5-form select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    background: transparent;
    font-family: inherit;
}
.h5-form textarea { min-height: 80px; resize: none; }
.h5-form input::placeholder,
.h5-form textarea::placeholder { color: #bbb; }

/* 手机号输入组 */
.h5-phone-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.h5-phone-group input { flex: 1; }
.h5-sms-btn {
    padding: 8px 14px;
    border: 1px solid #2a5298;
    border-radius: 18px;
    font-size: 12px;
    color: #2a5298;
    background: transparent;
    white-space: nowrap;
    cursor: pointer;
}
.h5-sms-btn:disabled {
    border-color: #ddd;
    color: #ccc;
    cursor: not-allowed;
}

/* 文件上传 */
.h5-upload {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.h5-upload-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}
.h5-upload-area {
    border: 1.5px dashed #d0d5dd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #aaa;
    cursor: pointer;
    transition: border-color .2s;
}
.h5-upload-area:active { border-color: #2a5298; color: #2a5298; }
.h5-upload-area i { font-size: 28px; margin-bottom: 6px; display: block; }

.h5-file-list { margin-top: 10px; }
.h5-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f7f9fc;
    border-radius: 8px;
    margin-bottom: 6px;
}
.h5-file-item .file-ic {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; flex-shrink: 0;
}
.h5-file-item .file-nm { flex: 1; font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-file-item .file-rm { color: #e74c3c; font-size: 14px; padding: 4px; }

/* ---------- 详情页 ---------- */
.h5-detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}
.h5-detail-row:last-child { border-bottom: none; }
.h5-detail-row .label {
    width: 80px;
    color: #999;
    flex-shrink: 0;
}
.h5-detail-row .value {
    flex: 1;
    color: #333;
    word-break: break-all;
}

/* 时间轴 */
.h5-timeline { padding: 6px 0; }
.h5-timeline-item {
    display: flex;
    gap: 10px;
    padding-bottom: 16px;
    position: relative;
}
.h5-timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 28px;
    bottom: -4px;
    width: 2px;
    background: #eef0f5;
}
.h5-timeline-item:last-child::before { display: none; }
.h5-timeline-item .dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #2a5298;
    margin-top: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(42,82,152,.15);
}
.h5-timeline-item .tl-body { flex: 1; }
.h5-timeline-item .tl-time { font-size: 11px; color: #aaa; }
.h5-timeline-item .tl-content { font-size: 13px; color: #333; margin-top: 2px; }

/* ---------- 个人中心 ---------- */
.profile-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 30px 20px;
    border-radius: 0 0 24px 24px;
    margin-bottom: 16px;
    color: #fff;
}
.profile-header .ph-row {
    display: flex; align-items: center; gap: 14px;
}
.profile-header .avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    backdrop-filter: blur(10px);
}
.profile-header .info .name { font-size: 18px; font-weight: 600; }
.profile-header .info .mobile { font-size: 13px; opacity: .85; margin-top: 2px; }

/* 功能列表 */
.h5-func-list .func-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background .1s;
}
.h5-func-list .func-item:active { background: #f7f9fc; }
.h5-func-list .func-item i.ic {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; flex-shrink: 0;
}
.h5-func-list .func-item .txt { flex: 1; font-size: 14px; }
.h5-func-list .func-item .arr { color: #ccc; }
.h5-func-list .func-item + .func-item { margin-top: 1px; }
.h5-func-list .func-item:first-child { border-radius: 10px 10px 0 0; }
.h5-func-list .func-item:last-child { border-radius: 0 0 10px 10px; }

/* ---------- 空状态 ---------- */
.h5-empty {
    padding: 60px 20px;
    text-align: center;
    color: #aaa;
}
.h5-empty i { font-size: 48px; margin-bottom: 12px; display: block; color: #ddd; }
.h5-empty .tip { font-size: 14px; }

/* ---------- Toast ---------- */
.h5-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn .2s ease;
    max-width: 80%;
    text-align: center;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Modal ---------- */
.h5-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    display: flex;
    align-items: flex-end;
    animation: fadeIn .2s;
}
.h5-modal {
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp .25s;
    margin: 0 auto;
}
.h5-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}
.h5-modal-header .close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: #aaa; font-size: 18px; cursor: pointer;
}
.h5-modal-body { padding: 16px; overflow-y: auto; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- 登录页 ---------- */
.h5-login-wrap {
    min-height: 100vh;
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 50%, #f4f5f9 100%);
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.h5-login-logo {
    width: 100%;
    max-width: 420px;
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
}
.h5-login-logo i {
    font-size: 48px;
    background: rgba(255,255,255,.2);
    width: 80px; height: 80px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    backdrop-filter: blur(10px);
}
.h5-login-logo h1 { font-size: 20px; font-weight: 600; }
.h5-login-logo p { font-size: 12px; opacity: .8; margin-top: 4px; }
.h5-login-logo .h5-login-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 14px;
    object-fit: contain;
    background: rgba(255,255,255,.2);
    padding: 6px;
    backdrop-filter: blur(10px);
    margin: 0 auto;
}

.h5-login-form {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
    margin-top: 35%;
}

/* ---------- 状态标签小圆角 ---------- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-gray { background: #f5f5f5; color: #616161; }

/* ---------- 分区块 ---------- */
.h5-section {
    margin-bottom: 16px;
}
.h5-section-title {
    font-size: 13px;
    color: #888;
    padding: 0 4px 8px;
    font-weight: 500;
}

/* ---------- 快捷操作悬浮按钮 ---------- */
.h5-fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(30,60,114,.4);
    z-index: 150;
    cursor: pointer;
    transition: transform .2s;
}
.h5-fab:active { transform: scale(.9); }

/* ---------- 颜色 ---------- */
.bg-blue   { background: linear-gradient(135deg, #667eea, #764ba2); }
.bg-green  { background: linear-gradient(135deg, #11998e, #38ef7d); }
.bg-orange { background: linear-gradient(135deg, #f093fb, #f5576c); }
.bg-purple { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.bg-red    { background: linear-gradient(135deg, #eb3349, #f45c43); }
.bg-gold   { background: linear-gradient(135deg, #f7971e, #ffd200); }
