* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #0f172a; font-size: 14px; line-height: 1.6; }

.hidden { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); border-bottom: 1px solid #e2e8f0; }
.topbar-inner { max-width: 750px; margin: 0 auto; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-user { font-size: 20px; cursor: pointer; }

.main { max-width: 750px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); border-top: 1px solid #e2e8f0; z-index: 100; }
.tabbar-inner { max-width: 750px; margin: 0 auto; display: flex; height: 60px; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #94a3b8; cursor: pointer; transition: color 0.2s; }
.tab-item.active { color: #0ea5e9; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-name { font-size: 11px; font-weight: 500; }

.card { background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(15,23,42,0.06); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #0f172a; }

.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 46px; padding: 0 20px; border: none; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.15s; background: #0ea5e9; color: #fff; }
.btn:hover:not(:disabled) { background: #0284c7; box-shadow: 0 6px 16px rgba(14,165,233,0.3); }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; box-shadow: none; }
.btn-success { background: #10b981; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger { background: #ef4444; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-group { display: flex; gap: 8px; }

.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.form-input { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 15px; outline: none; transition: all 0.2s; background: #fff; }
.form-input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 4px rgba(14,165,233,0.12); }
textarea.form-input { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.form-tip { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.required { color: #ef4444; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #64748b; }
.info-value { color: #0f172a; font-weight: 500; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-primary { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #64748b; }

.msg { font-size: 13px; min-height: 20px; margin-top: 8px; }
.msg-error { color: #ef4444; }
.msg-success { color: #10b981; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-item { background: #fff; border-radius: 16px; padding: 20px; text-align: center; box-shadow: 0 4px 16px rgba(15,23,42,0.06); }
.stat-value { font-size: 28px; font-weight: 700; color: #0ea5e9; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: #94a3b8; }

.role-switch { display: flex; gap: 8px; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.role-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; background: transparent; font-size: 14px; color: #64748b; cursor: pointer; font-weight: 500; }
.role-btn.active { background: #0ea5e9; color: #fff; box-shadow: 0 4px 12px rgba(14,165,233,0.25); }
.role-btn.secondary.active { background: #8b5cf6; }

.task-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(15,23,42,0.06); padding: 16px; margin-bottom: 12px; }
.task-image { width: 100%; height: 160px; background: #f1f5f9; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #94a3b8; margin-bottom: 12px; overflow: hidden; }
.task-image img { width: 100%; height: 100%; object-fit: cover; }
.task-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.task-desc { font-size: 13px; color: #64748b; margin-bottom: 12px; }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(15,23,42,0.9); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 9999; max-width: 300px; text-align: center; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-box { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 24px; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 16px; }

.avatar-circle { width: 64px; height: 64px; border-radius: 50%; background: #0ea5e9; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; margin: 0 auto 12px; overflow: hidden; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.empty { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

.loading { text-align: center; padding: 40px; color: #94a3b8; }

/* 树状图 */
.tree-wrap { padding: 8px 0; overflow-x: auto; }
.tree-farm { font-size: 14px; font-weight: 600; color: #0369a1; margin-bottom: 12px; text-align: center; }
.tree-level { padding-left: 0; }
.tree-children { padding-left: 20px; border-left: 2px dashed #e2e8f0; margin: 4px 0 4px 14px; }
.tree-branch { margin: 6px 0; }
.tree-node {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 10px;
    background: #f1f5f9; font-size: 13px;
    margin: 2px 0; white-space: nowrap;
    border: 1.5px solid transparent;
}
.tree-node.tree-owner { background: #fef3c7; color: #92400e; }
.tree-node.tree-manager { background: #e0f2fe; color: #0369a1; }
.tree-node.tree-leader { background: #ede9fe; color: #6d28d9; }
.tree-node.tree-sub { background: #f1f5f9; color: #475569; }
.tree-node.tree-daren { background: #d1fae5; color: #065f46; }
.tree-node.tree-me { background: #0ea5e9 !important; color: #fff !important; box-shadow: 0 4px 12px rgba(14,165,233,0.3); border-color: #0284c7; }
.tree-role { font-size: 11px; opacity: 0.75; }
.tree-name { font-weight: 500; }
.tree-badge { background: #fff; color: #0ea5e9; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 700; margin-left: 4px; }

/* 子页面入口 */
.sub-entry {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}
.sub-entry:last-child { border-bottom: none; }
.sub-entry:active { background: #f8fafc; }
.sub-entry-name {
    font-size: 15px;
    color: #0f172a;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}
.sub-entry-desc {
    font-size: 12px;
    color: #94a3b8;
    flex: 1;
    text-align: left;
}
.sub-entry-arrow {
    font-size: 20px;
    color: #cbd5e1;
    margin-left: 8px;
}
/* 微信风格列表 */
.list-item { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.15s; }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f8fafc; }
.list-label { flex-shrink: 0; font-size: 15px; color: #0f172a; }
.list-value { flex: 1; text-align: right; font-size: 14px; color: #64748b; margin: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-arrow { font-size: 20px; color: #cbd5e1; flex-shrink: 0; }
/* ============================================================ */
/* 主选项卡：达人任务 / 职务任务 */
/* ============================================================ */




/* ============================================================ */
/* 子选项卡：正职任务 / 副职任务 */
/* ============================================================ */



/* ============================================================ */
/* 子选项卡：正职任务 / 副职任务（小胶囊，靠左） */
/* ============================================================ */
.sub-tabs {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 10px !important;
    box-shadow: none !important;
}
.sub-tab {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 18px !important;
    border: none !important;
    border-radius: 18px !important;
    background: #f1f5f9 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: none !important;
    flex: none !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
}
.sub-tab.active {
    background: #0ea5e9 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
    font-weight: 600 !important;
}

/* ============================================================ */
/* 主选项卡：达人任务 / 职务任务（大按钮） */
/* ============================================================ */
.main-tabs {
    display: flex !important;
    background: #fff !important;
    border-radius: 14px !important;
    padding: 6px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
    gap: 6px !important;
}
.main-tab {
    flex: 1 !important;
    height: 44px !important;
    border: none !important;
    border-radius: 10px !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}
.main-tab.active {
    background: #0ea5e9 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
}